using System.Text.Json; using Codex.Dal.Enums; namespace Codex.Dal.Entities; /// /// Represents a tool or API integration available to an agent. /// One-to-many relationship: each agent has its own tool configurations. /// public class AgentTool { /// /// Unique identifier for this tool instance /// public Guid Id { get; set; } /// /// Foreign key to the owning agent /// public Guid AgentId { get; set; } /// /// Name of the tool (e.g., "file_reader", "code_executor", "github_api") /// public string ToolName { get; set; } = string.Empty; /// /// Type of tool /// public ToolType Type { get; set; } /// /// Tool-specific configuration stored as JSON (e.g., API endpoints, file paths, MCP server URLs) /// public JsonDocument? Configuration { get; set; } /// /// MCP server URL (if Type is McpServer) /// public string? McpServerUrl { get; set; } /// /// Encrypted authentication token for MCP server (if required) /// public string? McpAuthTokenEncrypted { get; set; } /// /// Base URL for REST API (if Type is RestApi) /// public string? ApiBaseUrl { get; set; } /// /// Encrypted API key for REST API (if required) /// public string? ApiKeyEncrypted { get; set; } /// /// Whether this tool is enabled for use /// public bool IsEnabled { get; set; } = true; /// /// When this tool was added to the agent /// public DateTime CreatedAt { get; set; } = DateTime.UtcNow; // Navigation properties /// /// The agent that owns this tool /// public Agent Agent { get; set; } = null!; }