/** * AgentOS Implementation * * Production platform for deploying AI agents as web services. * Implements the AgentOSProtocol for serving agents via HTTP. * * @example Basic Usage * ```typescript * import { AgentOS, Agent } from 'praisonai'; * * const assistant = new Agent({ * name: 'assistant', * instructions: 'Be helpful' * }); * * const app = new AgentOS({ * name: 'My AI App', * agents: [assistant] * }); * * await app.serve({ port: 8000 }); * ``` * * @example With Teams and Flows * ```typescript * const app = new AgentOS({ * name: 'My AI App', * agents: [assistant], * teams: [myTeam], * flows: [myFlow], * config: { port: 9000, debug: true } * }); * ``` */ import type { AgentOSProtocol } from './protocols'; import type { AgentOSConfig } from './config'; type Agent = { name?: string; role?: string; instructions?: string; chat: (message: string) => Promise; }; type AgentTeam = { agents?: Agent[]; start: () => Promise; }; type AgentFlow = { name?: string; run: (input: any) => Promise; }; /** * AgentOS constructor options */ export interface AgentOSOptions { /** Name of the application */ name?: string; /** List of Agent instances to serve */ agents?: any[]; /** List of AgentTeam instances to serve */ teams?: any[]; /** List of AgentFlow instances to serve */ flows?: any[]; /** Server configuration */ config?: AgentOSConfig; /** @deprecated Use `teams` instead */ managers?: any[]; /** @deprecated Use `flows` instead */ workflows?: any[]; } /** * Production platform for deploying AI agents as web services. * * AgentOS wraps agents, teams, and flows into a unified HTTP * application with REST endpoints. */ export declare class AgentOS implements AgentOSProtocol { /** Application name */ readonly name: string; /** List of Agent instances */ readonly agents: Agent[]; /** List of AgentTeam instances */ readonly teams: AgentTeam[]; /** List of AgentFlow instances */ readonly flows: AgentFlow[]; /** Merged configuration */ readonly config: Required> & { metadata: Record; }; /** HTTP server instance (lazy initialized) */ private _server; /** Express app instance (lazy initialized) */ private _app; /** * Create a new AgentOS instance. * * @param options - AgentOS options */ constructor(options?: AgentOSOptions); /** * Create the Express application. * * @returns Express app instance */ private _createApp; /** * Register API routes. * * @param app - Express app instance */ private _registerRoutes; /** * Get the Express application instance. * * @returns The Express application instance for custom mounting or configuration */ getApp(): any; /** * Start the AgentOS server. * * @param options - Server options * @returns Promise that resolves when server is listening */ serve(options?: { host?: string; port?: number; reload?: boolean; }): Promise; /** * Stop the AgentOS server. * * @returns Promise that resolves when server is stopped */ stop(): Promise; } /** * AgentApp - Silent alias for AgentOS (backward compatibility) * @deprecated Use AgentOS instead */ export declare const AgentApp: typeof AgentOS; /** * AgentAppOptions - Silent alias for AgentOSOptions (backward compatibility) * @deprecated Use AgentOSOptions instead */ export type AgentAppOptions = AgentOSOptions; export {};