/** * Agent Management Client * * Provides methods for: * - Creating, updating, and deleting agents * - Deploying and pausing agents * - Checking agent connection status * - Managing agent knowledge bases */ import { BaseClient, BaseClientConfig } from './base'; import type { Agent, CreateAgentRequest, UpdateAgentRequest, AgentDeployResponse, AgentPauseResponse, AgentDeleteResponse, AgentConnectionStatusResponse, InitAgentRequest, InitAgentResponse, PaginatedAgentResponse, ListAgentsOptions, CreateOutboundCallRequest, CreateOutboundCallResponse } from '../types'; /** * Client for Agent management operations */ export declare class AgentClient extends BaseClient { constructor(config: BaseClientConfig); /** * List agents with optional pagination and filtering * * @param options - Pagination and filter options * @returns Paginated list of agents or array of agents * * @example * ```typescript * // Get all deployed agents * const result = await client.agents.list({ * page: 1, * limit: 10, * show_statuses: ['deployed'] * }); * * for (const agent of result.items) { * console.log(`${agent.name}: ${agent.status}`); * } * ``` */ list(options?: ListAgentsOptions): Promise; /** * Create a new agent * * @param options - Agent creation options * @returns Created agent * * @example * ```typescript * const agent = await client.agents.create({ * name: 'Customer Support Agent', * config: { * prompt: 'You are a helpful customer support agent.', * greeting: 'Hello! How can I help you today?', * tts_params: { * voice_id: 'my-voice-id' * } * } * }); * * console.log('Created agent:', agent.agent_id); * ``` */ create(options: CreateAgentRequest): Promise; /** * Get agent details by ID * * @param agentId - The agent ID * @returns Agent details * * @example * ```typescript * const agent = await client.agents.getById('agent-123'); * console.log('Agent config:', agent.config); * ``` */ getById(agentId: string): Promise; /** * Update an existing agent * * @param agentId - The agent ID to update * @param options - Fields to update * @returns Updated agent * * @example * ```typescript * const updated = await client.agents.update('agent-123', { * name: 'Updated Agent Name', * config: { * greeting: 'Hi there! What can I do for you?' * } * }); * ``` */ update(agentId: string, options: UpdateAgentRequest): Promise; /** * Deploy an agent (prepare for phone calls) * * @param agentId - The agent ID to deploy * @returns Deployment response with agent and status * * @example * ```typescript * const result = await client.agents.deploy('agent-123'); * console.log('Deployed:', result.message); * console.log('SIP status:', result.sip_status); * ``` */ deploy(agentId: string): Promise; /** * Pause an agent (frees phone number) * * This endpoint is idempotent. * * @param agentId - The agent ID to pause * @returns Pause response with agent * * @example * ```typescript * const result = await client.agents.pause('agent-123'); * console.log('Agent status:', result.agent.status); * ``` */ pause(agentId: string): Promise; /** * Delete an agent * * An agent must be paused before being deleted. * * @param agentId - The agent ID to delete * @returns Delete response * * @example * ```typescript * await client.agents.pause('agent-123'); * await client.agents.disable('agent-123'); * ``` */ disable(agentId: string): Promise; /** Alias for {@link disable} */ delete(agentId: string): Promise; /** * Initialize agent from template * * @param options - Template options * @returns Template configuration and available types * * @example * ```typescript * // Get available templates * const result = await client.agents.initFromTemplate(); * console.log('Available types:', result.available_types); * * // Initialize from specific template * const template = await client.agents.initFromTemplate({ * agent_template: 'customer_support' * }); * ``` */ initFromTemplate(options?: InitAgentRequest): Promise; /** * Check if an agent is available for connection * * @param agentId - The agent ID to check * @returns Agent connection status * * @example * ```typescript * const status = await client.agents.getStatus('agent-123'); * * if (status.call_allowed) { * console.log('Agent is available for calls'); * } else { * console.log('Reason:', status.call_validation_details); * } * ``` */ getStatus(agentId: string): Promise; /** * Create an outbound call for an agent. * * Requires backend-side credentials (service token or dev API key). */ createOutboundCall(options: CreateOutboundCallRequest): Promise; /** * Assign a knowledge base to an agent for RAG * * @param agentId - The agent ID * @param kbId - The knowledge base ID to assign * @returns Updated agent * * @example * ```typescript * const agent = await client.agents.assignKnowledgeBase('agent-123', 42); * console.log('KB assigned:', agent.kb_id); * ``` */ assignKnowledgeBase(agentId: string, kbId: number): Promise; /** * Remove knowledge base from an agent * * @param agentId - The agent ID * * @example * ```typescript * await client.agents.unassignKnowledgeBase('agent-123'); * ``` */ unassignKnowledgeBase(agentId: string): Promise; } //# sourceMappingURL=agents.d.ts.map