Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Contributing to agent-browser

First off, thank you for considering contributing to `agent-browser`! It's people like you that make `agent-browser` such a great tool.

## Setting up the development environment

1. Fork and clone the repository.
2. Ensure you have Node.js installed.
3. Install dependencies:
```bash
npm install
```
4. Build the project:
```bash
npm run build
```
5. Run the tests to ensure everything is working:
```bash
npm test
```

## Coding Style Guidelines

- We use Prettier for code formatting and ESLint for linting.
- Before committing, ensure your code matches the project's style.
- Use TypeScript and ensure all types are correctly defined.
- Write tests for any new features or bug fixes.

## Submitting a Pull Request

1. Create a new branch for your feature or bugfix:
```bash
git checkout -b feature/my-new-feature
```
2. Make your changes and commit them with descriptive commit messages.
3. Push your branch to your fork:
```bash
git push origin feature/my-new-feature
```
4. Open a Pull Request against the `main` branch of the `dextonai/agent-browser` repository.
5. Provide a clear description of the changes in the PR description.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# agent-browser

[![Build Status](https://github.com/dextonai/agent-browser/actions/workflows/ci.yml/badge.svg)](https://github.com/dextonai/agent-browser/actions)

Headless browser automation CLI for AI agents. Fast Rust CLI with Node.js fallback.

## Installation
Expand Down
55 changes: 55 additions & 0 deletions apply_fix.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
cat << 'EOF' > CONTRIBUTING.md
# Contributing to agent-browser

First off, thank you for considering contributing to `agent-browser`! It's people like you that make `agent-browser` such a great tool.

## Setting up the development environment

1. Fork and clone the repository.
2. Ensure you have Node.js installed.
3. Install dependencies:
```bash
npm install
```
4. Build the project:
```bash
npm run build
```
5. Run the tests to ensure everything is working:
```bash
npm test
```

## Coding Style Guidelines

- We use Prettier for code formatting and ESLint for linting.
- Before committing, ensure your code matches the project's style.
- Use TypeScript and ensure all types are correctly defined.
- Write tests for any new features or bug fixes.

## Submitting a Pull Request

1. Create a new branch for your feature or bugfix:
```bash
git checkout -b feature/my-new-feature
```
2. Make your changes and commit them with descriptive commit messages.
3. Push your branch to your fork:
```bash
git push origin feature/my-new-feature
```
4. Open a Pull Request against the `main` branch of the `dextonai/agent-browser` repository.
5. Provide a clear description of the changes in the PR description.
EOF

if [ -f "README.md" ]; then
if grep -q "^#" README.md; then
awk '!done && /^# / {print; print "\n[![Build Status](https://github.com/dextonai/agent-browser/actions/workflows/ci.yml/badge.svg)](https://github.com/dextonai/agent-browser/actions)"; done=1; next} 1' README.md > README.md.tmp && mv README.md.tmp README.md
else
echo "[![Build Status](https://github.com/dextonai/agent-browser/actions/workflows/ci.yml/badge.svg)](https://github.com/dextonai/agent-browser/actions)" | cat - README.md > README.md.tmp && mv README.md.tmp README.md
fi
else
echo "# agent-browser" > README.md
echo "" >> README.md
echo "[![Build Status](https://github.com/dextonai/agent-browser/actions/workflows/ci.yml/badge.svg)](https://github.com/dextonai/agent-browser/actions)" >> README.md
fi
59 changes: 59 additions & 0 deletions fix_script.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import os
import requests
import json
import subprocess

api_key = os.environ.get("OPENAI_API_KEY", "anything")
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {api_key}"
}

# 1. Read all TS/JS files in src/
files_content = ""
for root, _, files in os.walk("src"):
for file in files:
if file.endswith((".ts", ".js", ".py", ".java")):
path = os.path.join(root, file)
with open(path, "r") as f:
files_content += f"--- {path} ---\n{f.read()}\n\n"

prompt = f"""You are an expert engineer.
Issue: https://github.com/dextonai/agent-browser/issues/1
Description:
## Add a README badge and contribution guide to agent-browser

Add a contribution guide (CONTRIBUTING.md) and a status badge to the README.md in the dextonai/agent-browser repository. The CONTRIBUTING.md should include: how to set up the dev environment, coding style guidelines, and how to submit a PR. The README badge should show the build status. This is a simple documentation task.

**Reward:** 1.000000000000000000 DXTN
**Mode:** competition
**Deadline:** None

---
To claim this bounty, submit a PR referencing `bounty:8e29b86d-2387-4a5a-bd72-69afaa74c4ad` in the PR body.

_Managed by [DextonHub](https://dextonhub.com). [View bounty](https://dextonhub.com/app/bounties/8e29b86d-2387-4a5a-bd72-69afaa74c4ad)_

Files:
{files_content}

Your job is to provide ONLY a valid bash script that patches the files using tools like sed, awk, or echoing entire rewritten files.
Do NOT use markdown code blocks, just raw bash commands so I can pipe it directly to bash.
"""

payload = {
"model": "gemini-3.1-pro-preview",
"messages": [{"role": "user", "content": prompt}],
"max_tokens": 4096
}

resp = requests.post("http://172.25.176.1:4000/v1/chat/completions", headers=headers, json=payload)
data = resp.json()
bash_code = data["choices"][0]["message"]["content"].strip()
if bash_code.startswith("```bash"):
bash_code = bash_code[7:-3]
elif bash_code.startswith("```"):
bash_code = bash_code[3:-3]

with open("apply_fix.sh", "w") as f:
f.write(bash_code)