import { z } from 'zod'; import type { ServerStatus, ServerTransport, ServerType, LogLevel } from '../types/common.types'; import type { Tool } from './tool.model'; import type { Resource } from './resource.model'; /** * Server runtime configuration (flat format, merged template + instance) * Used by connection manager and frontend for actual server execution */ export interface ServerRuntimeConfig { command?: string; args?: string[]; url?: string; env?: Record; headers?: Record; timeout?: number; enabled?: boolean; aggregatedTools?: string[]; type: ServerTransport; tags?: Record; description?: string; proxy?: { url: string; }; } /** * Instance selection strategy constants for multi-instance servers */ export declare const InstanceSelectionStrategy: { readonly RANDOM: "random"; readonly ROUND_ROBIN: "round-robin"; readonly TAG_MATCH_UNIQUE: "tag-match-unique"; }; export type InstanceSelectionStrategy = (typeof InstanceSelectionStrategy)[keyof typeof InstanceSelectionStrategy]; /** * Transport type constants for MCP server connections */ export declare const TransportType: { readonly STDIO: "stdio"; readonly SSE: "sse"; readonly STREAMABLE_HTTP: "streamable-http"; readonly HTTP: "http"; readonly STREAMABLE_HTTP_LOCAL: "streamable-http-local"; }; export type TransportType = (typeof TransportType)[keyof typeof TransportType]; /** * Server Environment Configuration Base Schema * Shared by both ServerTemplate and ServerInstance (for overrides) */ export declare const ServerEnvConfigSchema: z.ZodObject<{ args: z.ZodDefault>; env: z.ZodDefault>; headers: z.ZodDefault>; proxy: z.ZodOptional>; }, z.core.$strip>; export type ServerEnvConfig = z.infer; /** * Server Instance Metadata Schema * Shared by ServerInstance and ServerInstanceConfig */ export declare const ServerInstanceMetadataSchema: z.ZodObject<{ id: z.ZodString; index: z.ZodOptional; displayName: z.ZodOptional; }, z.core.$strip>; export type ServerInstanceMetadata = z.infer; /** * Server Instance Runtime State Schema * Shared by ServerInstance and ServerInstanceConfig */ export declare const ServerInstanceRuntimeSchema: z.ZodObject<{ timestamp: z.ZodOptional; pid: z.ZodOptional; startTime: z.ZodOptional; }, z.core.$strip>; export type ServerInstanceRuntime = z.infer; /** * Tag Definition Schema * Defines metadata about a tag key for validation and UI purposes */ export declare const TagDefinitionSchema: z.ZodObject<{ key: z.ZodString; description: z.ZodOptional; type: z.ZodDefault>; values: z.ZodOptional>; }, z.core.$strip>; export type TagDefinition = z.infer; /** * Server Instance Configuration Schema * Represents a single instance of a server with specific configuration */ export declare const ServerInstanceSchema: z.ZodObject<{ id: z.ZodString; index: z.ZodOptional; displayName: z.ZodOptional; timestamp: z.ZodOptional>; pid: z.ZodOptional>; startTime: z.ZodOptional>; enabled: z.ZodDefault; args: z.ZodDefault>; env: z.ZodDefault>; headers: z.ZodDefault>; proxy: z.ZodOptional>; tags: z.ZodDefault>; }, z.core.$strip>; export type ServerInstance = z.infer; /** * Server Instance Update Schema (without defaults) * Used for partial updates to server instances - intentionally omits default values * to prevent overwriting existing configuration with empty defaults. */ export declare const ServerInstanceUpdateSchema: z.ZodObject<{ id: z.ZodOptional; index: z.ZodOptional; displayName: z.ZodOptional; timestamp: z.ZodOptional; pid: z.ZodOptional; startTime: z.ZodOptional; enabled: z.ZodOptional; args: z.ZodOptional>; env: z.ZodOptional>; headers: z.ZodOptional>; proxy: z.ZodOptional>; tags: z.ZodOptional>; }, z.core.$strip>; export type ServerInstanceUpdate = z.infer; /** * Server Template Configuration Schema * Template configuration that can be shared across multiple instances */ export declare const ServerTemplateSchema: z.ZodObject<{ args: z.ZodDefault>; env: z.ZodDefault>; headers: z.ZodDefault>; proxy: z.ZodOptional>; command: z.ZodOptional; type: z.ZodDefault>; timeout: z.ZodDefault; url: z.ZodOptional; aggregatedTools: z.ZodDefault>; description: z.ZodOptional; instanceSelectionStrategy: z.ZodOptional>; readyPatterns: z.ZodOptional>; }, z.core.$strip>; export type ServerTemplate = z.infer; /** * Server Configuration Schema (v1.1 - Primary) * A server with a template and multiple instances */ export declare const ServerConfigSchema: z.ZodObject<{ template: z.ZodObject<{ args: z.ZodDefault>; env: z.ZodDefault>; headers: z.ZodDefault>; proxy: z.ZodOptional>; command: z.ZodOptional; type: z.ZodDefault>; timeout: z.ZodDefault; url: z.ZodOptional; aggregatedTools: z.ZodDefault>; description: z.ZodOptional; instanceSelectionStrategy: z.ZodOptional>; readyPatterns: z.ZodOptional>; }, z.core.$strip>; instances: z.ZodDefault; displayName: z.ZodOptional; timestamp: z.ZodOptional>; pid: z.ZodOptional>; startTime: z.ZodOptional>; enabled: z.ZodDefault; args: z.ZodDefault>; env: z.ZodDefault>; headers: z.ZodDefault>; proxy: z.ZodOptional>; tags: z.ZodDefault>; }, z.core.$strip>>>; tagDefinitions: z.ZodDefault; type: z.ZodDefault>; values: z.ZodOptional>; }, z.core.$strip>>>; }, z.core.$strip>; export type ServerConfig = z.infer; /** * Logging Configuration Schema */ export declare const LoggingConfigSchema: z.ZodDefault>; rotationAge: z.ZodDefault; jsonPretty: z.ZodDefault; mcpCommDebug: z.ZodDefault; apiDebug: z.ZodDefault; gatewayDebug: z.ZodDefault; showTraceContext: z.ZodDefault; }, z.core.$strip>>; export type LoggingConfig = z.infer; /** * Security Configuration Schema */ export declare const SecurityConfigSchema: z.ZodDefault>; maxConcurrentConnections: z.ZodDefault; connectionTimeout: z.ZodDefault; idleConnectionTimeout: z.ZodDefault; maxConnections: z.ZodDefault; }, z.core.$strip>>; export type SecurityConfig = z.infer; /** * Startup Configuration Schema * Unified configuration for server startup behavior */ export declare const StartupConfigSchema: z.ZodDefault; readyTimeout: z.ZodDefault; maxConnectRetries: z.ZodDefault; connectRetryDelay: z.ZodDefault; }, z.core.$strip>>; export type StartupConfig = z.infer; /** * System Configuration Schema (v1.1 - Primary) */ export declare const SystemConfigSchema: z.ZodObject<{ version: z.ZodDefault>; system: z.ZodDefault; port: z.ZodDefault; language: z.ZodDefault>; theme: z.ZodDefault>; logging: z.ZodDefault>; rotationAge: z.ZodDefault; jsonPretty: z.ZodDefault; mcpCommDebug: z.ZodDefault; apiDebug: z.ZodDefault; gatewayDebug: z.ZodDefault; showTraceContext: z.ZodDefault; }, z.core.$strip>>; startup: z.ZodOptional; readyTimeout: z.ZodDefault; maxConnectRetries: z.ZodDefault; connectRetryDelay: z.ZodDefault; }, z.core.$strip>>>; session: z.ZodOptional>>; stateless: z.ZodDefault>>; }, z.core.$strip>>>; defaultSessionMode: z.ZodDefault>>; }, z.core.$strip>>; }, z.core.$strip>>; security: z.ZodDefault>; maxConcurrentConnections: z.ZodDefault; connectionTimeout: z.ZodDefault; idleConnectionTimeout: z.ZodDefault; maxConnections: z.ZodDefault; }, z.core.$strip>>; servers: z.ZodDefault>; env: z.ZodDefault>; headers: z.ZodDefault>; proxy: z.ZodOptional>; command: z.ZodOptional; type: z.ZodDefault>; timeout: z.ZodDefault; url: z.ZodOptional; aggregatedTools: z.ZodDefault>; description: z.ZodOptional; instanceSelectionStrategy: z.ZodOptional>; readyPatterns: z.ZodOptional>; }, z.core.$strip>; instances: z.ZodDefault; displayName: z.ZodOptional; timestamp: z.ZodOptional>; pid: z.ZodOptional>; startTime: z.ZodOptional>; enabled: z.ZodDefault; args: z.ZodDefault>; env: z.ZodDefault>; headers: z.ZodDefault>; proxy: z.ZodOptional>; tags: z.ZodDefault>; }, z.core.$strip>>>; tagDefinitions: z.ZodDefault; type: z.ZodDefault>; values: z.ZodOptional>; }, z.core.$strip>>>; }, z.core.$strip>>>; tagDefinitions: z.ZodDefault; type: z.ZodDefault>; values: z.ZodOptional>; }, z.core.$strip>>>; }, z.core.$strip>; export type SystemConfig = z.infer; /** Session configuration extracted from SystemConfig.system.session */ export type GatewayConfig = SystemConfig['system']['session']; /** * Server instance runtime configuration (for connection manager) * Contains runtime-specific fields like timestamp, pid, etc. */ export declare const ServerInstanceConfigSchema: z.ZodObject<{ id: z.ZodString; index: z.ZodOptional; displayName: z.ZodOptional; timestamp: z.ZodNonOptional>; pid: z.ZodOptional; startTime: z.ZodOptional; }, z.core.$strip>; export type ServerInstanceConfig = z.infer; /** * Server instance configuration interface */ export interface ServerInstanceConfigLegacy { id: string; timestamp: number; hash: string; index?: number; displayName?: string; } /** * Log entry interface */ export interface LogEntry { timestamp: number; level: LogLevel; message: string; } /** * Server status information interface */ export interface StatusInfo { id: string; status: { connected: boolean; error?: string; lastCheck: number; toolsCount: number; resourcesCount: number; pid?: number; startTime?: number; version?: string; hash?: string; }; } /** * Unified server model interface */ export interface Server { id: string; name: string; status: ServerStatus; type: ServerType; config: ServerRuntimeConfig; instance?: ServerInstanceConfig; instances?: (ServerInstanceConfig & { status: ServerStatus; })[]; logs: LogEntry[]; uptime?: string; startTime?: number; pid?: number; tools?: Tool[]; resources?: Resource[]; toolsCount?: number; resourcesCount?: number; version?: string; rawV11Config?: ServerConfig; } //# sourceMappingURL=server.model.d.ts.map