aboutsummaryrefslogtreecommitdiff
path: root/src/registry.ts
diff options
context:
space:
mode:
authoramankumarsingh77 <amankumarsingh7702@gmail.com>2026-07-08 21:13:15 +0530
committeramankumarsingh77 <amankumarsingh7702@gmail.com>2026-07-08 21:13:15 +0530
commitc5c42df5976ed63faac2adcf3b04a4ad2f519b32 (patch)
tree77d389a590864eaf5c2408c9bc99ed07f55343d8 /src/registry.ts
parent7826c950adee89512162185d07fee565ab0e96cc (diff)
feat: add browser_web_search tool (real-Chrome SERP scrape, no API key)
Thin query→ranked-links primitive. Isolated-attach tab lifecycle mirroring browser_open_urls (never touches the user's current tab); pure Google SERP parser with semantic (a h3) extraction and redirect unwrapping; CAPTCHA and no-results surfaced as invalid_state + details.reason. Fixture-based parser tests (9 scenarios). Establishes the isolated-tab lifecycle and tsx+fixture test convention that browser_read_page and deep-research build on. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'src/registry.ts')
-rw-r--r--src/registry.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/registry.ts b/src/registry.ts
index 22e2fa6..c7ff5c8 100644
--- a/src/registry.ts
+++ b/src/registry.ts
@@ -19,6 +19,7 @@ import { consoleTool } from "./domains/console";
import { snapshotTool } from "./domains/snapshot";
import { executeJsTool, runScriptTool } from "./domains/js";
import { setupTool } from "./domains/setup";
+import { webSearchTool } from "./domains/search/web-search";
// Mutation tools that modify page / browser state are marked `serialized: true`
// so they run through a shared async mutex. Observation / read-only tools are
@@ -61,6 +62,8 @@ const TOOLS: ReadonlyArray<AnyBrowserToolDefinition> = [
snapshotTool,
executeJsTool,
runScriptTool,
+ // Opens and owns an isolated tab to scrape a SERP — same class as openUrlsTool.
+ { ...webSearchTool, serialized: true },
];
export const registerAllTools = (pi: ExtensionAPI, client: BrowserClient): void => {