/** * useAgent Hook - React hook for managing Agent lifecycle * * Provides a simple interface for executing AI-powered automation tasks * with state management for running status, results, errors, and history. * * Requirements: 1.1, 1.2, 1.3 */ import { Agent } from '../core/Agent'; import { AgentConfig, AgentResult, AgentHistory } from '../types'; export interface UseAgentReturn { /** Execute a task with the agent */ execute: (task: string, maxSteps?: number) => Promise; /** Whether agent is currently running */ isRunning: boolean; /** Result from last execution (null if not completed) */ result: AgentResult | null; /** Error from last execution (null if no error) */ error: string | null; /** Stop the currently running agent */ stop: () => void; /** Complete execution history */ history: AgentHistory[]; /** Current agent instance (null if not running) */ agent: Agent | null; } /** * React hook for managing Agent execution * * @param config - Agent configuration with API key and settings * @returns Object with execute function, state, and controls * * @example * ```tsx * const { execute, isRunning, result, error } = useAgent({ * apiKey: 'YOUR_GEMINI_API_KEY', * maxSteps: 50, * debugMode: true, * }) * * // Execute a task * await execute('Open Instagram and like the first post') * * // Check result * if (result?.success) { * console.log('Task completed:', result.message) * } * ``` */ export declare function useAgent(config: AgentConfig): UseAgentReturn; //# sourceMappingURL=useAgent.d.ts.map