claude-browser-bridge 3.0.2 → 3.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +60 -29
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -224,35 +224,66 @@ const HELP_TOOL = {
224
224
  inputSchema: { type: "object", properties: {} },
225
225
  };
226
226
 
227
- const HELP_TEXT = `# Claude Browser Bridge — 57 Tools Usage Guide
228
-
229
- ## CRITICAL RULES (read before using ANY tool):
230
- 1. ALWAYS start with \`diagnose\` it returns snapshot + console errors + network failures + API responses in ONE call. NEVER call snapshot, get_console, get_network separately.
231
- 2. Use \`batch\` for 2+ independent calls — e.g. batch([{name:"get_cookies"}, {name:"get_storage"}]).
232
- 3. Pin with \`select_tab\` once, then stop passing tab_id — the pin persists.
233
- 4. Use \`new_tab\` for research — NEVER navigate away from the app tab.
234
- 5. After EVERY CSS/UI code change, take a \`screenshot\` to verify. Never claim "this should work" without seeing it.
235
- 6. Use \`inject_css\` to test CSS fixes instantly without rebuilding, then write to file once confirmed.
236
- 7. After 3 failed fix attempts, search the web: new_tab({url:"https://google.com/search?q=..."}).
237
-
238
- ## Tool Categories:
239
- - Core: diagnose, batch, select_tab, snapshot, eval, screenshot, full_page_screenshot, get_page_text, get_html, get_page_info
240
- - Interaction: click, fill, hover, scroll, press_key, select_option, upload_file, highlight_element
241
- - Navigation: navigate, new_tab, close_tab, go_back, go_forward, reload, list_tabs, wait_for
242
- - Debugging: get_console, get_grouped_console, get_network, search_network_bodies, get_styles, get_cookies, get_storage, get_clipboard, watch_dom_changes, generate_selector
243
- - Performance: performance_trace, heap_snapshot_summary, get_load_timeline
244
- - Accessibility: get_accessibility_tree, check_contrast
245
- - Emulation: emulate_device, network_throttle, set_geolocation, toggle_dark_mode
246
- - Testing: visual_diff, inject_css, mock_network, record_actions, replay_actions, handle_dialog
247
- - Productivity: save_form_profile, load_form_profile, save_tab_session, restore_tab_session, edit_cookie, export_pdf
248
-
249
- ## Key Workflows:
250
- - Investigate a page: diagnose → read errors → fix → screenshot to verify
251
- - Visual bug fix: batch([screenshot, get_styles]) → edit code → screenshot → compare → iterate
252
- - Performance audit: batch([performance_trace, heap_snapshot_summary, get_load_timeline])
253
- - Accessibility check: batch([get_accessibility_tree, check_contrast])
254
- - Test error states: mock_network({url_pattern:"/api/x", status_code:500}) → reloadscreenshot
255
- - Record regression test: record_actions → reproduce bug → stop → fix → replay_actions to verify
227
+ const HELP_TEXT = `# Claude Browser Bridge — 58 Tools
228
+
229
+ ## WHICH TOOL FIRST? (decision tree)
230
+ - Investigating a bug diagnose (gives snapshot + errors + network + API responses in ONE call)
231
+ - Fixing CSS/visual batch([screenshot, get_styles({selector:".target"}), get_html({selector:".target"})])
232
+ - Performance check batch([performance_trace, get_load_timeline, heap_snapshot_summary])
233
+ - Accessibility audit batch([get_accessibility_tree, check_contrast({selector:".text"})])
234
+ - Reading page content eval (specific data) or get_page_text (all text)
235
+ - Interacting with page diagnose first (get refs), then click/fill using refs
236
+ - Opening a URL for research new_tab (NEVER navigate away from the app tab)
237
+ - Don't know → diagnose (covers 80% of needs)
238
+
239
+ ## 10 CRITICAL RULES:
240
+ 1. diagnose FIRST, always. ONE call replaces snapshot+get_console+get_network.
241
+ 2. batch for parallel. 2+ independent calls always batch. Every sequential call wastes 2-3 seconds.
242
+ 3. select_tab once, never again. Pin target tab at start, stop passing tab_id.
243
+ 4. new_tab for research. NEVER navigate the app tab to docs/Google.
244
+ 5. screenshot after EVERY code edit. Never claim a fix works without seeing it.
245
+ 6. inject_css before editing files. Test CSS live, confirm with screenshot, THEN write to file.
246
+ 7. eval for state. React state, Redux store, variables — faster than parsing page text.
247
+ 8. get_styles for CSS. Never guess computed values — read them.
248
+ 9. 3 failed attempts = search web. new_tab + Google search. Stop guessing.
249
+ 10. Use refs from diagnose/snapshot for click/fill. Never guess CSS selectors.
250
+
251
+ ## KEY WORKFLOWS:
252
+
253
+ Visual/CSS Fix:
254
+ batch([screenshot, get_styles, get_html]) inject_css({css:"..."}) → screenshotif good, write to file
255
+
256
+ Bug Investigation:
257
+ diagnose → read errors → batch([get_grouped_console, get_network]) → fix → screenshot → verify
258
+
259
+ Performance Audit:
260
+ batch([performance_trace, get_load_timeline, heap_snapshot_summary])
261
+
262
+ Page Interaction:
263
+ diagnose → fill({ref:"ref_3", value:"..."}) → click({ref:"ref_0"}) → wait_for({text:"Success"})
264
+
265
+ Multi-tab Research:
266
+ select_tab(app) → new_tab(docs) → get_page_text → close_tab → continue on app
267
+
268
+ Error State Testing:
269
+ mock_network({url_pattern:"/api/cart", status_code:500}) → reload → screenshot
270
+
271
+ Regression Testing:
272
+ record_actions → reproduce → stop → fix → replay_actions → screenshot
273
+
274
+ Before/After Comparison:
275
+ screenshot (save dataUrl) → make changes → visual_diff({before_dataUrl:"..."})
276
+
277
+ ## ALL 58 TOOLS BY CATEGORY:
278
+ Core: diagnose, batch, select_tab, snapshot, eval, screenshot, full_page_screenshot, get_page_text, get_html, get_page_info, browser_bridge_help
279
+ Interaction: click, fill, hover, scroll, press_key, select_option, upload_file, highlight_element
280
+ Navigation: navigate, new_tab, close_tab, go_back, go_forward, reload, list_tabs, wait_for
281
+ Debugging: get_console, get_grouped_console, get_network, search_network_bodies, get_styles, get_cookies, get_storage, get_clipboard, watch_dom_changes, generate_selector
282
+ Performance: performance_trace, heap_snapshot_summary, get_load_timeline
283
+ Accessibility: get_accessibility_tree, check_contrast
284
+ Emulation: emulate_device, network_throttle, set_geolocation, toggle_dark_mode
285
+ Testing: visual_diff, inject_css, mock_network, record_actions, replay_actions, handle_dialog
286
+ Productivity: save_form_profile, load_form_profile, save_tab_session, restore_tab_session, edit_cookie, export_pdf
256
287
  `;
257
288
 
258
289
  const BATCH_TOOL = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-browser-bridge",
3
- "version": "3.0.2",
3
+ "version": "3.0.4",
4
4
  "description": "Connect your live Chrome tabs to Claude Code — 57 tools for debugging, performance, accessibility, device emulation, and browser automation.",
5
5
  "type": "module",
6
6
  "bin": {