Integrate OpenHandoff factory workspace (#212)

This commit is contained in:
Nathan Flurry 2026-03-09 14:00:20 -07:00 committed by GitHub
parent 3d9476ed0b
commit bf282199b5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
251 changed files with 42824 additions and 692 deletions

View file

@ -1,21 +1,29 @@
# Snapshot + Refs Workflow
# Snapshot and Refs
The core innovation of agent-browser: compact element references that reduce context usage dramatically for AI agents.
Compact element references that reduce context usage dramatically for AI agents.
## How It Works
**Related**: [commands.md](commands.md) for full command reference, [SKILL.md](../SKILL.md) for quick start.
### The Problem
Traditional browser automation sends full DOM to AI agents:
## Contents
- [How Refs Work](#how-refs-work)
- [Snapshot Command](#the-snapshot-command)
- [Using Refs](#using-refs)
- [Ref Lifecycle](#ref-lifecycle)
- [Best Practices](#best-practices)
- [Ref Notation Details](#ref-notation-details)
- [Troubleshooting](#troubleshooting)
## How Refs Work
Traditional approach:
```
Full DOM/HTML sent → AI parses → Generates CSS selector → Executes action
~3000-5000 tokens per interaction
Full DOM/HTML → AI parses → CSS selector → Action (~3000-5000 tokens)
```
### The Solution
agent-browser uses compact snapshots with refs:
agent-browser approach:
```
Compact snapshot → @refs assigned → Direct ref interaction
~200-400 tokens per interaction
Compact snapshot → @refs assigned → Direct interaction (~200-400 tokens)
```
## The Snapshot Command
@ -166,8 +174,8 @@ agent-browser snapshot -i
### Element Not Visible in Snapshot
```bash
# Scroll to reveal element
agent-browser scroll --bottom
# Scroll down to reveal element
agent-browser scroll down 1000
agent-browser snapshot -i
# Or wait for dynamic content