export { BrowserClient, checkHealth, executeBrowserTask, executeWithRecording, getErrors, getRecording, getWebp, waitForRecording } from './core.js'; import { BrowserTaskInput, BrowserConfig, BrowserTaskResult } from './types.js'; export { AuthCredentials, BrowserError, BrowserModel, BrowserTaskInputWithSchema, BrowserTaskWithPromise, BrowserTaskWithPromiseAndSchema, ErrorsResponse, IframeOptions, LiveSessionOptions, RecordingStatus, RecordingWithMethods, WebpOptions, WebpResponse } from './types.js'; export { BROWSER_SYSTEM_PROMPT, BROWSER_TOOL_DESCRIPTION } from './prompts.js'; export { LIVE_PRESETS, buildEmbedCode, buildLiveIframe, buildLiveUrl } from './live.js'; export { a as anthropic } from '../../anthropic-B6my2oBx.js'; export { o as openai } from '../../openai-BQMeDFef.js'; export { v as vercel } from '../../vercel-CVF27qFK.js'; import { FunctionDeclaration } from '@google/generative-ai'; export { ProfilesClient } from './profiles/core.js'; export { CreateProfileInput, Profile, ProfileListResponse, ProfileSession, ProfileSessionInput, ProfileSetup, ProfileStateResponse, ProfileWithMethods, RepoListResponse, RepoSummary, SaveProfileSessionInput } from './profiles/types.js'; export { MorphAPIError, MorphAuthenticationError, MorphError, MorphErrorCode, MorphNotFoundError, MorphProfileLimitError, MorphRateLimitError, MorphValidationError, parseAPIError } from './errors.js'; import '../../core/client.js'; import '../utils/resilience.js'; import '../../core/resource.js'; import '@anthropic-ai/sdk/resources/messages.mjs'; import 'openai/resources/chat/completions.mjs'; import 'ai'; /** * Google Gemini SDK adapter for browser automation tool */ /** * Gemini-native browser function declaration * * @example * ```typescript * import { GoogleGenerativeAI } from '@google/generative-ai'; * import { browserFunctionDeclaration, execute } from '@morphllm/morphsdk/tools/browser/gemini'; * * const genAI = new GoogleGenerativeAI(process.env.GOOGLE_API_KEY); * const model = genAI.getGenerativeModel({ * model: 'gemini-3-flash-preview', * tools: [{ functionDeclarations: [browserFunctionDeclaration] }] * }); * * const chat = model.startChat(); * const result = await chat.sendMessage('Test the checkout flow'); * * // Handle function call * const call = result.response.functionCalls()?.[0]; * if (call) { * const taskResult = await execute(call.args, { apiKey: 'key' }); * console.log(taskResult); * } * ``` */ declare const browserFunctionDeclaration: FunctionDeclaration; /** * Execute browser task * * @param input - Tool input with task and optional url/maxSteps * @param config - Configuration with apiKey * @returns Task execution result */ declare function execute(input: BrowserTaskInput | string, config?: BrowserConfig): Promise; /** * Format browser task result for Gemini tool result * * Returns a concise summary suitable for agent context. The full result object * (with urls, errors, action_history, judgement, etc.) is available when calling * execute() directly, but this formatted string omits those details to save tokens. * * @param result - Browser task result with full history data * @returns Formatted string summary for tool result */ declare function formatResult(result: BrowserTaskResult): string; /** * Get system prompt for browser automation */ declare function getSystemPrompt(): string; /** * Gemini tool with execute method attached */ interface GeminiBrowserTool extends FunctionDeclaration { execute: (input: BrowserTaskInput | string) => Promise; formatResult: (result: BrowserTaskResult) => string; getSystemPrompt: () => string; } /** * Create a configured browser tool with execute and formatResult methods * * @param config - Browser worker configuration * @returns Function declaration with execute and formatResult methods * * @example * ```typescript * import { GoogleGenerativeAI, FunctionCallingMode } from '@google/generative-ai'; * import { createBrowserTool } from '@morphllm/morphsdk/tools/browser/gemini'; * * const tool = createBrowserTool({ apiKey: process.env.MORPH_API_KEY }); * * const genAI = new GoogleGenerativeAI(process.env.GOOGLE_API_KEY); * const model = genAI.getGenerativeModel({ * model: 'gemini-3-flash-preview', * tools: [{ functionDeclarations: [tool] }], * toolConfig: { functionCallingConfig: { mode: FunctionCallingMode.AUTO } } * }); * * const chat = model.startChat(); * const result = await chat.sendMessage('Test the checkout flow at https://example.com'); * * // Handle function call * const call = result.response.functionCalls()?.[0]; * if (call && call.name === tool.name) { * const taskResult = await tool.execute(call.args); * console.log(tool.formatResult(taskResult)); * * // Send result back to model * await chat.sendMessage([{ * functionResponse: { * name: call.name, * response: { result: tool.formatResult(taskResult) } * } * }]); * } * ``` */ declare function createBrowserTool(config?: BrowserConfig): GeminiBrowserTool; declare const browserTool: FunctionDeclaration; type gemini_GeminiBrowserTool = GeminiBrowserTool; declare const gemini_browserFunctionDeclaration: typeof browserFunctionDeclaration; declare const gemini_browserTool: typeof browserTool; declare const gemini_createBrowserTool: typeof createBrowserTool; declare const gemini_execute: typeof execute; declare const gemini_formatResult: typeof formatResult; declare const gemini_getSystemPrompt: typeof getSystemPrompt; declare namespace gemini { export { type gemini_GeminiBrowserTool as GeminiBrowserTool, gemini_browserFunctionDeclaration as browserFunctionDeclaration, gemini_browserTool as browserTool, gemini_createBrowserTool as createBrowserTool, browserFunctionDeclaration as default, gemini_execute as execute, gemini_formatResult as formatResult, gemini_getSystemPrompt as getSystemPrompt }; } export { BrowserConfig, BrowserTaskInput, BrowserTaskResult, gemini };