import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core"; import * as z from "zod/v4"; import type { ToolSession } from "../sdk"; import { type BrowserKindTag } from "./browser/registry"; import type { Observation, ScreenshotResult } from "./browser/tab-protocol"; import type { OutputMeta } from "./output-meta"; export { extractReadableFromHtml, type ReadableFormat, type ReadableResult } from "./browser/readable"; export type { Observation, ObservationEntry } from "./browser/tab-protocol"; declare const browserSchema: z.ZodObject<{ action: z.ZodEnum<{ close: "close"; open: "open"; run: "run"; }>; name: z.ZodOptional; url: z.ZodOptional; app: z.ZodOptional; cdp_url: z.ZodOptional; args: z.ZodOptional>; target: z.ZodOptional; }, z.core.$strip>>; viewport: z.ZodOptional; }, z.core.$strip>>; wait_until: z.ZodOptional>; dialogs: z.ZodOptional>; code: z.ZodOptional; timeout: z.ZodOptional>; all: z.ZodOptional; kill: z.ZodOptional; }, z.core.$strip>; /** Input schema for the browser tool. */ export type BrowserParams = z.infer; /** Details describing a browser tool execution result (for renderers + transcript). */ export interface BrowserToolDetails { action: BrowserParams["action"]; name?: string; url?: string; browser?: BrowserKindTag; viewport?: { width: number; height: number; deviceScaleFactor?: number; }; observation?: Observation; screenshots?: ScreenshotResult[]; result?: string; meta?: OutputMeta; } /** * Browser tool: stateful, multi-tab. Three actions: * - `open` → acquire/create a named tab on a browser kind (headless | spawned | connected) and optionally goto a url. * - `close` → release a named tab (or all tabs); dispose browser when refcount hits 0. * - `run` → execute JS code against an existing tab with `page`/`browser`/`tab` helpers in scope. */ export declare class BrowserTool implements AgentTool { #private; private readonly session; readonly name = "browser"; readonly label = "Browser"; readonly loadMode = "discoverable"; readonly summary = "Control a headless browser to navigate and interact with web pages"; readonly parameters: z.ZodObject<{ action: z.ZodEnum<{ close: "close"; open: "open"; run: "run"; }>; name: z.ZodOptional; url: z.ZodOptional; app: z.ZodOptional; cdp_url: z.ZodOptional; args: z.ZodOptional>; target: z.ZodOptional; }, z.core.$strip>>; viewport: z.ZodOptional; }, z.core.$strip>>; wait_until: z.ZodOptional>; dialogs: z.ZodOptional>; code: z.ZodOptional; timeout: z.ZodOptional>; all: z.ZodOptional; kill: z.ZodOptional; }, z.core.$strip>; readonly strict = true; constructor(session: ToolSession); get description(): string; /** Restart browser to apply mode changes (e.g. headless toggle). Drops only headless browsers. */ restartForModeChange(): Promise; execute(_toolCallId: string, params: BrowserParams, signal?: AbortSignal, _onUpdate?: AgentToolUpdateCallback, _ctx?: AgentToolContext): Promise>; }