import type { AnthropicBrowserExecutor } from "./anthropic-browser.js"; import type { AnthropicComputerExecutor } from "./anthropic-computer.js"; import type { GeminiExecutor } from "./gemini.js"; export interface LoopResult { /** The model's final text answer, empty if it never gave one. */ text: string; turns: number; /** Why the loop ended. */ stoppedBy: "done" | "max-turns" | "declined"; /** The whole conversation, for logging or continuing it. */ transcript: T[]; } export interface ClaudeLoopOptions { executor: AnthropicBrowserExecutor | AnthropicComputerExecutor; /** Calls the Messages API with your model and settings; we supply `tools` and `messages`. */ createMessage: (request: { tools: unknown[]; messages: unknown[]; }) => Promise<{ content: unknown[]; stop_reason?: string; }>; task: string; maxTurns?: number; /** Screenshots kept in the conversation sent to the model. Default 3. */ keepImages?: number; } /** Asks Claude, runs its browser actions, sends back the results, and repeats * until Claude answers or `maxTurns` is reached. */ export declare function runClaudeLoop(opts: ClaudeLoopOptions): Promise>; interface GeminiContent { role: string; parts: unknown[]; } export interface GeminiLoopOptions { executor: GeminiExecutor; /** Calls `models/:generateContent` with your model; we supply `contents` and `tools`. */ generateContent: (request: { contents: GeminiContent[]; tools: unknown[]; }) => Promise<{ candidates?: Array<{ content?: GeminiContent; }>; }>; task: string; maxTurns?: number; keepImages?: number; } /** The generateContent form of the computer-use tool declaration. */ export declare const GEMINI_GENERATE_TOOLS: { computerUse: { environment: string; }; }[]; /** Sends the task with a first screenshot, runs Gemini's actions, sends back the * results, and repeats until Gemini answers, a person declines a confirmation, * or `maxTurns` is reached. */ export declare function runGeminiLoop(opts: GeminiLoopOptions): Promise>; export {}; //# sourceMappingURL=loops.d.ts.map