UNPKG

@codai/romai-types

Version:

Shared TypeScript types for ROMAI ecosystem - Romanian AI Central Intelligence

186 lines (184 loc) 4.53 kB
interface RomaiConfig { azure: AzureOpenAIConfig; memory: MemoryConfig; mcp: McpConfig; api: ApiConfig; } interface AzureOpenAIConfig { apiKey?: string; endpoint?: string; apiVersion?: string; deploymentName?: string; } interface MemoryConfig { provider: 'memorai' | 'local' | 'redis'; config: Record<string, unknown>; } interface McpConfig { port: number; name: string; version: string; description: string; } interface ApiConfig { port: number; cors: CorsConfig; rateLimit: RateLimitConfig; auth: AuthConfig; } interface CorsConfig { origin: string | string[]; credentials: boolean; } interface RateLimitConfig { windowMs: number; max: number; } interface AuthConfig { jwtSecret: string; expiresIn: string; } interface AIMessage { id: string; role: 'user' | 'assistant' | 'system'; content: string; timestamp: Date; metadata?: Record<string, unknown>; } interface AIResponse { message: AIMessage; usage?: TokenUsage; model?: string; finishReason?: string; } interface TokenUsage { promptTokens: number; completionTokens: number; totalTokens: number; } interface AIRequest { messages: AIMessage[]; model?: string; temperature?: number; maxTokens?: number; stream?: boolean; } interface McpTool { name: string; description: string; inputSchema: Record<string, unknown>; } interface McpToolCall { name: string; arguments: Record<string, unknown>; } interface McpResource { uri: string; name: string; description?: string; mimeType?: string; } interface McpServer { name: string; version: string; description: string; tools: McpTool[]; resources: McpResource[]; } interface MemoryEntry { id: string; content: string; embedding?: number[]; metadata: MemoryMetadata; timestamp: Date; } interface MemoryMetadata { entityType?: string; importance?: number; tags?: string[]; sessionId?: string; userId?: string; [key: string]: unknown; } interface MemoryQuery { query: string; limit?: number; threshold?: number; filters?: Record<string, unknown>; } interface MemoryResult { entry: MemoryEntry; similarity: number; } interface ApiError { code: string; message: string; details?: Record<string, unknown>; } interface ApiResponse<T = unknown> { success: boolean; data?: T; error?: ApiError; timestamp: Date; } interface IntelligenceRequest { query: string; context?: string; language?: 'ro' | 'en'; domain?: string; userId?: string; sessionId?: string; } interface IntelligenceResponse { response: string; confidence: number; sources?: string[]; relatedTopics?: string[]; suggestions?: string[]; } interface RomaiEvent { type: string; payload: Record<string, unknown>; timestamp: Date; source: string; } type EventHandler<T = Record<string, unknown>> = (event: RomaiEvent & { payload: T; }) => void | Promise<void>; type DeepPartial<T> = { [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P]; }; type NonEmptyArray<T> = [T, ...T[]]; type Prettify<T> = { [K in keyof T]: T[K]; } & {}; interface RomanianContext { dialect?: 'moldovenesc' | 'oltenesc' | 'ardelean' | 'standard'; formality?: 'formal' | 'informal'; domain?: 'business' | 'technical' | 'academic' | 'casual'; } interface LocalizationData { language: string; region: string; currency: string; dateFormat: string; timeFormat: string; } interface PerformanceMetrics { responseTime: number; tokenUsage: TokenUsage; memoryAccess: number; cacheHits: number; errorRate: number; } interface HealthCheck { status: 'healthy' | 'degraded' | 'unhealthy'; timestamp: Date; services: Record<string, ServiceHealth>; } interface ServiceHealth { status: 'healthy' | 'degraded' | 'unhealthy'; responseTime?: number; error?: string; } export type { AIMessage, AIRequest, AIResponse, ApiConfig, ApiError, ApiResponse, AuthConfig, AzureOpenAIConfig, CorsConfig, DeepPartial, EventHandler, HealthCheck, IntelligenceRequest, IntelligenceResponse, LocalizationData, McpConfig, McpResource, McpServer, McpTool, McpToolCall, MemoryConfig, MemoryEntry, MemoryMetadata, MemoryQuery, MemoryResult, NonEmptyArray, PerformanceMetrics, Prettify, RateLimitConfig, RomaiConfig, RomaiEvent, RomanianContext, ServiceHealth, TokenUsage };