diff options
| author | amankumarsingh77 <amankumarsingh7702@gmail.com> | 2026-07-08 21:24:32 +0530 |
|---|---|---|
| committer | amankumarsingh77 <amankumarsingh7702@gmail.com> | 2026-07-08 21:24:32 +0530 |
| commit | 68bf7fd2988e42343833be09e4115cd7175029d0 (patch) | |
| tree | 52b8eaf99fa7e4d383ff169dd3bdccfe13911217 /src/registry.ts | |
| parent | c5c42df5976ed63faac2adcf3b04a4ad2f519b32 (diff) | |
feat: add browser_read_page reader-mode tool
URL (or owned targetId) → clean main-article text with nav/ads/footer
boilerplate stripped, via a dependency-free readability heuristic. DOM walk
lives in an in-page capture expression; scoring/selection is a pure, fixture-
tested function (link-density + boilerplate-ancestor filtering, body-text
fallback for structure-less pages). Reuses the isolated-attach lifecycle;
registered unserialized (safe concurrent read). 10 extractor unit scenarios.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'src/registry.ts')
| -rw-r--r-- | src/registry.ts | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/registry.ts b/src/registry.ts index c7ff5c8..a063c9f 100644 --- a/src/registry.ts +++ b/src/registry.ts @@ -20,6 +20,7 @@ import { snapshotTool } from "./domains/snapshot"; import { executeJsTool, runScriptTool } from "./domains/js"; import { setupTool } from "./domains/setup"; import { webSearchTool } from "./domains/search/web-search"; +import { readPageTool } from "./domains/readpage/read-page"; // Mutation tools that modify page / browser state are marked `serialized: true` // so they run through a shared async mutex. Observation / read-only tools are @@ -64,6 +65,8 @@ const TOOLS: ReadonlyArray<AnyBrowserToolDefinition> = [ runScriptTool, // Opens and owns an isolated tab to scrape a SERP — same class as openUrlsTool. { ...webSearchTool, serialized: true }, + // Pure isolated read (own sessionId, own tab) — safe concurrent, like executeJsTool. + readPageTool, ]; export const registerAllTools = (pi: ExtensionAPI, client: BrowserClient): void => { |
