/** * Web + browser agent-tool FAMILY — registration (T1742 · epic T11456 · SG-TOOLS). * * Registers the `web` toolset into the {@link ./agent-registry.js | * AgentToolRegistry}, on top of the terminal/file/search/git families * ({@link ./agent-tool-families.js}): * * - **AC1** `web_search` — pluggable, backend-agnostic search * ({@link ./web-search-backends.js}); graceful `unavailable` result when no * backend can answer. NO hard paid-API dependency. * - **AC2** `web_extract` — fetch a URL + convert HTML to markdown. * - **AC3** `browser_navigate` — Playwright (lazily, optionally loaded). * - **AC4** `browser_click` / `browser_type` / `browser_press`. * - **AC5** `browser_snapshot` — accessibility tree. * - **AC6** `browser_vision` — screenshot + AI analysis routed THROUGH the E9 * `resolveLLMForSystem` chokepoint + sealed-credential handle (never a raw * provider call). * - **AC7** `browser_scroll` up / down. * - **AC8** all registered; the browser tools' `available()` returns `false` * (with an install hint) when Playwright is absent. * * Browser tools share ONE lazily-launched {@link BrowserSession} per registration * (a closure cell), so the optional Playwright load happens at most once per run. * The web tools' network egress flows through an injectable {@link HttpFetch}; the * vision AI call flows through the single E9 chokepoint — neither bypasses the * resolver / credential layer. Import-time side-effect-free (NO top-level * playwright import). * * @epic T11456 * @task T1742 * @see ./browser-driver.js — the optional-Playwright lazy-load backend * @see ./web-search-backends.js — the pluggable search backends + HTML→markdown */ import type { AgentToolRegistry } from './agent-registry.js'; import { BrowserSession } from './browser-driver.js'; import { type HttpFetch } from './web-search-backends.js'; /** * Options for {@link registerWebAgentTools} — all injectable so tests run with * NO real network and NO real browser launch (AC9). */ export interface WebAgentToolOptions { /** Injected HTTP fetch (defaults to the platform `fetch`). */ readonly http?: HttpFetch; /** Injected browser session (defaults to a real lazy-Playwright session). */ readonly browser?: BrowserSession; /** * SearXNG instance URL for the `searxng` backend. When omitted, the SearXNG * backend reports unconfigured and only DuckDuckGo answers — preserving the * "graceful when unconfigured" contract (AC1). Read from `SEARXNG_URL` env when * not supplied. */ readonly searxngUrl?: string; /** * Project root threaded into the E9 `resolveLLMForSystem` chokepoint for * `browser_vision` (defaults to the resolver's own `process.cwd()` fallback). */ readonly projectRoot?: string; } /** * Register the web + browser agent-tool family into `registry`. Pure * registration — no network, no browser launch, no scan; side effects happen * later through the injected {@link HttpFetch} / {@link BrowserSession}. * * The browser tools are registered with a `playwright`-gated availability * predicate (AC8): present in the registry but hidden by `available()` until a * context advertises the optional Playwright capability. * * @param registry - The registry to populate. * @param options - Injectable backends (HTTP fetch, browser session, searxng URL). */ export declare function registerWebAgentTools(registry: AgentToolRegistry, options?: WebAgentToolOptions): void; //# sourceMappingURL=web-agent-tools.d.ts.map