Skip to content
Merged
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
5 changes: 5 additions & 0 deletions .changeset/remove-browse-refs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"browse": patch
---

Remove the `browse refs` command. It only re-printed the `xpathMap`/`urlMap` cached from the last `browse snapshot` — which `browse snapshot` already returns — so it was redundant, and it returned stale maps if the page had changed since that snapshot.
3 changes: 1 addition & 2 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ browse back # Navigate backward
browse forward # Navigate forward
```

### Snapshot & refs
### Snapshot

The accessibility snapshot is the recommended way for agents to discover elements. It prints a tree of refs like `@0-12` that the element commands accept directly.

Expand All @@ -93,7 +93,6 @@ browse snapshot # Accessibility snapshot + cached refs
browse snapshot --compact # Tree only, no ref maps
browse snapshot --filter submit # Filter lines by text or /regex/, keeping ancestors
browse snapshot --max-depth 4 # Trim output deeper than this depth
browse refs # Show refs cached from the last snapshot
```

### Element actions
Expand Down
1 change: 0 additions & 1 deletion packages/cli/skills/browse/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ Page state:
```bash
browse snapshot
browse snapshot --compact
browse refs
browse get url
browse get title
browse get text body
Expand Down
21 changes: 0 additions & 21 deletions packages/cli/src/commands/refs.ts

This file was deleted.

9 changes: 0 additions & 9 deletions packages/cli/src/lib/driver/commands/snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,4 @@ export const snapshotHandlers: DriverCommandHandlers = {
xpathMap: snapshot.xpathMap,
};
},

async refs(manager) {
const refMaps = manager.getRefMaps();
return {
count: Object.keys(refMaps.xpathMap).length,
urlMap: refMaps.urlMap,
xpathMap: refMaps.xpathMap,
};
},
};
1 change: 0 additions & 1 deletion packages/cli/src/lib/driver/commands/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export const DRIVER_COMMAND_NAMES = [
"network.on",
"network.path",
"open",
"refs",
"reload",
"screenshot",
"select",
Expand Down
4 changes: 0 additions & 4 deletions packages/cli/src/lib/driver/session-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,6 @@ export class DriverSessionManager {
this.refMaps = refMaps;
}

getRefMaps(): RefMaps {
return this.refMaps;
}

async openResult(page: DriverPage): Promise<OpenResult> {
return {
...this.browserbaseIdentity(),
Expand Down
Loading