claude-flow
Version:
Ruflo - Enterprise AI agent orchestration for Claude Code. Deploy 60+ specialized agents in coordinated swarms with self-learning, fault-tolerant consensus, vector memory, and MCP integration
61 lines • 2.35 kB
TypeScript
/**
* GAIA Tool: web_browse — ADR-133-PR5
*
* Opens a URL in a headless Chromium browser via Playwright and extracts
* page content (text, HTML, or screenshot). Covers the ~10-15pp of GAIA
* Level-1 questions that require navigating dynamic JS pages, video pages
* (YouTube, Vimeo), and paywalled/login-required content.
*
* ============================================================
* PLAYWRIGHT DEPENDENCY — OPT-IN INSTALL
* ============================================================
* Playwright is NOT a hard runtime dep of @claude-flow/cli. It is loaded
* lazily via a dynamic import so the package installs cleanly without it.
*
* To use web_browse, run once:
* npm install playwright
* npx playwright install chromium
*
* If Playwright is not installed, execute() returns a structured error
* message that Claude can relay to the user rather than crashing.
*
* Install size: ~80 MB for the Playwright package + Chromium binary.
* Add as a devDependency in benchmark-specific contexts to avoid bloating
* the production bundle.
*
* ============================================================
* RESOURCE CAPS
* ============================================================
* - Text/HTML extraction capped at 8 000 characters (prevents context-window
* overflow; roughly 2 000 tokens).
* - Default timeout: 30 seconds.
* - Screenshots returned as base64-encoded PNG strings.
* - Browser instance is always closed in a `finally` block.
*
* Refs: ADR-133, #2156
*/
import { GaiaTool, ToolDefinition } from './types.js';
export type BrowseExtract = 'text' | 'html' | 'screenshot';
export interface WebBrowseInput {
url: string;
wait_for_selector?: string;
extract?: BrowseExtract;
timeout_seconds?: number;
}
export interface WebBrowseResult {
content: string;
final_url: string;
status: number;
truncated?: boolean;
}
export declare class WebBrowseTool implements GaiaTool {
readonly name = "web_browse";
readonly definition: ToolDefinition;
execute(input: Record<string, unknown>): Promise<string>;
}
export interface WebBrowseToolOptions {
/** Override default timeout in milliseconds. */
defaultTimeoutMs?: number;
}
export declare function createWebBrowseTool(_opts?: WebBrowseToolOptions): WebBrowseTool;
//# sourceMappingURL=web_browse.d.ts.map