import { AgentCard } from '@a2a-js/sdk'; import express from 'express'; import { A2AModule } from './modules/a2a/a2a.module.js'; import { AuthModule } from './modules/auth/auth.module.js'; import { MCPModule } from './modules/mcp/mcp.module.js'; import { MemoryModule } from './modules/memory/memory.module.js'; import { ModelModule } from './modules/models/model.module.js'; import { AinAgentManifest, OnIntentFallback } from './types/agent.js'; export { IntentFallbackContext } from './types/agent.js'; import { AuthzConfig } from './types/authz.js'; import './types/connector.js'; import './types/stream.js'; import './types/memory.js'; import './types/auth.js'; import './types/mcp.js'; import '@modelcontextprotocol/sdk/client/sse.js'; import '@modelcontextprotocol/sdk/client/stdio.js'; import '@modelcontextprotocol/sdk/client/streamableHttp.js'; import './modules/memory/base.memory.js'; import './types/document.js'; import './types/list.js'; import './types/schedule.js'; import './modules/models/base.model.js'; import 'http-status-codes'; /** * Main class for AI Network Agent Development Kit (AIN-ADK). * * AINAgent orchestrates all modules and provides an Express server for handling * agent interactions through both standard query endpoints and A2A protocol endpoints. * * @example * ```typescript * const manifest = { * name: "MyAgent", * description: "An example AI agent", * }; * * const agent = new AINAgent(manifest, { * modelModule: new ModelModule(), * a2aModule: new A2AModule(), * mcpModule: new MCPModule() * }); * * agent.start(3000); * ``` */ declare class AINAgent { /** Express application instance */ app: express.Application; /** Agent manifest containing metadata and configuration */ manifest: AinAgentManifest; /** Modules */ modelModule: ModelModule; memoryModule: MemoryModule; authModule?: AuthModule; a2aModule?: A2AModule; mcpModule?: MCPModule; authz?: AuthzConfig; /** Optional fallback handler when intent matching fails */ onIntentFallback?: OnIntentFallback; /** * Creates a new AINAgent instance. * * @param manifest - Agent manifest containing name, description, version, and optional URL * @param modules - Required and optional modules for the agent * @param modules.modelModule - Required module for AI model integrations * @param modules.a2aModule - Optional module for A2A protocol support * @param modules.mcpModule - Optional module for MCP server connections * @param modules.memoryModule - Optional module for memory management * @param authScheme - Authentication middleware for securing endpoints * @param options - Optional configuration options * @param options.onIntentFallback - Fallback handler when intent matching fails */ constructor(manifest: AinAgentManifest, modules: { authModule: AuthModule; modelModule: ModelModule; memoryModule: MemoryModule; a2aModule?: A2AModule; mcpModule?: MCPModule; authz?: AuthzConfig; }, options?: { onIntentFallback?: OnIntentFallback; }); /** * Initializes Express middlewares for security, CORS, and body parsing. * Also applies authentication middleware if configured. */ private initializeMiddlewares; /** * Generates an A2A protocol agent card for discovery. * * The agent card contains metadata about the agent's capabilities, * supported input/output modes, and connection information. * * @returns AgentCard object with agent metadata and capabilities * @throws Error if manifest URL is invalid or missing */ generateAgentCard: () => AgentCard; /** * Initializes all HTTP routes including health check, agent discovery, * query endpoints, and optional A2A endpoints. * * Routes initialized: * - GET / - Health check endpoint * - GET /.well-known/agent.json - Agent card discovery endpoint * - /query/* - Query processing endpoints * - /api/* - API endpoints for agent management * - /a2a/* - A2A protocol endpoints (only if valid URL is configured) */ private initializeRoutes; /** * Starts the Express server on the specified port. * * @param port - The port number to listen on */ start(port: number): Promise; } export { AINAgent, AinAgentManifest, OnIntentFallback };