aboutsummaryrefslogtreecommitdiff
path: root/src/domains/snapshot.ts
diff options
context:
space:
mode:
authorPatrick Barattin <p.barattin@gmail.com>2026-10-11 20:25:38 +0200
committerGitHub <noreply@github.com>2026-10-11 23:55:38 +0530
commit014de0ec21936a7a2fd64db9d151e73c79bb44ad (patch)
tree654a0a50eb2a88a14f55458e75dfb55e1c5779f5 /src/domains/snapshot.ts
parent79526b01f4d3cf16c3cfb46313cf1179f0db40ac (diff)
refactor: remove duplicate browser prompt instructions (#35)
Remove browser instruction text repeated across tool descriptions, parameter schemas, tool guidelines and the global browser prompt. Tool names, schemas, handlers and concurrency are unchanged; shared recovery and ownership guidance is now available before and after the browser connects, and the prompt names which tools are serialized versus observations. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Diffstat (limited to 'src/domains/snapshot.ts')
-rw-r--r--src/domains/snapshot.ts5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/domains/snapshot.ts b/src/domains/snapshot.ts
index 86c5fe3..68f49b4 100644
--- a/src/domains/snapshot.ts
+++ b/src/domains/snapshot.ts
@@ -98,10 +98,7 @@ export const snapshotTool = defineBrowserTool({
"DEFAULT tool for understanding what is on the page. Returns the structured accessibility tree (roles, names, states, hierarchy). Every interactive element gets a stable ref shown as [eN] plus click coordinates @(x,y). Pass the ref to browser_click/browser_fill/etc. — refs survive re-renders, coordinates don't. Use this BEFORE deciding whether you need a screenshot. Pair with browser_execute_js for surgical reads of specific element values.",
promptSnippet: "Get accessibility-tree snapshot with stable element refs (default for page inspection)",
promptGuidelines: [
- "DEFAULT — use this whenever you need to know what's on a page, what's clickable, or how the page is structured.",
- "Refs come for free: every interactive element shows '[eN]' in the outline. Pass eN as `ref` to browser_click/browser_fill/browser_select_option/browser_focus/browser_upload_file — refs survive re-renders, so prefer them over the '@(x,y)' coordinates (a fallback).",
- "DO NOT call browser_screenshot just to understand the page. This tool already gives you structure, labels, states, refs, and click targets.",
- "Re-run after a navigation or a major re-render to get fresh refs; a 'ref is stale' error from an interaction tool means you need a new snapshot.",
+ "Re-run browser_snapshot after a navigation or a major re-render to get fresh refs.",
"Pass includeScreenshot:true ONLY if you also need to verify visual rendering (rare).",
"format:'json' returns the raw slim structure (with `ref` and `box` per node) for programmatic use; default 'outline' is human/LLM-readable.",
],