import { ComputerUseSession, type ComputerUseOptions, type Observation } from "./session.js"; /** A function call in either Gemini response shape: an Interactions API step * (`type: "function_call"`) or a generateContent part (`functionCall`). */ export type GeminiCall = { type: "function_call"; id?: string; name: string; arguments?: Record; } | { functionCall: { id?: string; name: string; args?: Record; }; }; export interface SafetyRequest { action: string; explanation: string; arguments: Record; } export interface GeminiOptions extends ComputerUseOptions { /** Asked before any action Gemini marks `require_confirmation`. Returning * false stops the run. Without it such actions are declined. */ confirm?: (request: SafetyRequest) => Promise; /** Keep tabs a page opens as separate tabs. Default false: the opened page * replaces the current one, since Gemini works in a single tab. */ keepTabs?: boolean; /** Where the legacy `search` action goes. Default https://www.google.com. */ searchUrl?: string; } /** Interactions API result item. */ export interface GeminiFunctionResult { type: "function_result"; name: string; call_id?: string; result: Array<{ type: "text"; text: string; } | { type: "image"; data: string; mime_type: string; }>; } /** generateContent result part. */ export interface GeminiFunctionResponsePart { functionResponse: { id?: string; name: string; response: Record; parts: Array<{ inlineData: { mimeType: string; data: string; }; }>; }; } export interface GeminiRunResult { /** One result per executed call, in order. */ results: R[]; /** True when a person declined a confirmation; stop the loop. */ terminated: boolean; /** Calls to functions this executor does not run (your own tools); answer them yourself. */ unhandled: GeminiCall[]; } /** Runs Gemini computer-use actions (browser environment) on a browser reached * through Browser Gateway and builds the function results Gemini expects. */ export declare class GeminiExecutor { readonly session: ComputerUseSession; private readonly opts; private constructor(); static connect(opts: GeminiOptions): Promise; /** The `tools` entry for an Interactions API request. */ declaration(): { type: "computer_use"; environment: "browser"; }; /** The screenshot and address to send with the first request. */ initialObservation(): Promise; /** Runs every computer-use call in a response, in order, and returns one result * per call carrying the page address and a fresh screenshot. A failed action * is reported in its result and the rest still run, as Gemini expects. */ run(calls: unknown[]): Promise>; close(): Promise; private dispatch; private clickAt; private scroll; private point; /** Gemini works in one tab: a page the action opened replaces the current one. */ private collapsePopups; } //# sourceMappingURL=gemini.d.ts.map