export interface GenerationStatistics {
    total_duration?: number;
    load_duration?: number;
    prompt_eval_count?: number;
    prompt_eval_duration?: number;
    eval_count?: number;
    eval_duration?: number;
    tokens_per_second?: number;
    created_at?: string;
    model?: string;
}
export interface Artifact {
    id: string;
    type: 'html' | 'react' | 'svg' | 'mermaid' | 'chart' | 'code' | 'text' | 'json';
    title: string;
    content: string;
    language?: string;
    description?: string;
    createdAt: number;
    updatedAt: number;
}
export interface ChatMessage {
    id: string;
    role: 'user' | 'assistant' | 'system';
    content: string;
    timestamp: number;
    model?: string;
    images?: string[];
    statistics?: GenerationStatistics;
    artifacts?: Artifact[];
    parentId?: string;
    branchIndex?: number;
    isActive?: boolean;
    siblingCount?: number;
}
export interface ChatSession {
    id: string;
    title: string;
    messages: ChatMessage[];
    model: string;
    createdAt: number;
    updatedAt: number;
    personaId?: string;
}
export interface GenerationOptions {
    temperature?: number;
    top_p?: number;
    top_k?: number;
    min_p?: number;
    typical_p?: number;
    num_predict?: number;
    seed?: number;
    repeat_last_n?: number;
    repeat_penalty?: number;
    presence_penalty?: number;
    frequency_penalty?: number;
    penalize_newline?: boolean;
    num_ctx?: number;
    num_batch?: number;
    num_keep?: number;
    stop?: string[];
    numa?: boolean;
    num_thread?: number;
    num_gpu?: number;
    main_gpu?: number;
    use_mmap?: boolean;
    format?: string | Record<string, unknown>;
    raw?: boolean;
    keep_alive?: string;
    stream?: boolean;
}
export interface EmbeddingSettings {
    enabled: boolean;
    model: string;
    chunkSize: number;
    chunkOverlap: number;
    similarityThreshold: number;
}
export interface TTSSettings {
    enabled: boolean;
    autoPlay: boolean;
    model: string;
    voice: string;
    speed: number;
    pluginId?: string;
    streamSentences?: boolean;
}
export interface TitleSettings {
    autoTitle: boolean;
    taskModel: string;
}
export interface UserPreferences {
    defaultModel: string;
    theme: {
        mode: 'light' | 'dark' | 'ophelia';
    };
    systemMessage: string;
    generationOptions: GenerationOptions;
    embeddingSettings: EmbeddingSettings;
    ttsSettings?: TTSSettings;
    titleSettings?: TitleSettings;
    showUsername: boolean;
    backgroundSettings?: {
        enabled: boolean;
        imageUrl: string;
        blurAmount: number;
        opacity: number;
    };
}
export interface OllamaChatMessage {
    role: 'system' | 'user' | 'assistant' | 'tool';
    content: string;
    thinking?: string;
    images?: string[];
    tool_calls?: Record<string, unknown>[];
}
export interface OllamaChatRequest {
    model: string;
    messages: OllamaChatMessage[];
    tools?: Record<string, unknown>[];
    think?: boolean;
    format?: string | Record<string, unknown>;
    options?: Record<string, unknown>;
    stream?: boolean;
    keep_alive?: string;
}
export interface OllamaChatResponse {
    model: string;
    created_at: string;
    message: {
        role: string;
        content: string;
        images?: string[] | null;
        tool_calls?: Record<string, unknown>[];
    };
    done: boolean;
    done_reason?: string;
    total_duration?: number;
    load_duration?: number;
    prompt_eval_count?: number;
    prompt_eval_duration?: number;
    eval_count?: number;
    eval_duration?: number;
}
export interface OllamaBlobRequest {
    digest: string;
}
export interface OllamaModel {
    name: string;
    size: number;
    digest: string;
    modified_at: string;
    details?: {
        format?: string;
        family?: string;
        families?: string[];
        parameter_size?: string;
        quantization_level?: string;
    };
}
export interface OllamaGenerateRequest {
    model: string;
    prompt: string;
    stream?: boolean;
    options?: {
        temperature?: number;
        top_p?: number;
        top_k?: number;
        num_predict?: number;
        stop?: string[];
    };
}
export interface OllamaGenerateResponse {
    model: string;
    created_at: string;
    response: string;
    done: boolean;
    context?: number[];
    total_duration?: number;
    load_duration?: number;
    prompt_eval_count?: number;
    prompt_eval_duration?: number;
    eval_count?: number;
    eval_duration?: number;
}
export interface OllamaShowRequest {
    model: string;
    verbose?: boolean;
}
export interface OllamaCreateRequest {
    model: string;
    from?: string;
    files?: Record<string, string>;
    adapters?: Record<string, string>;
    template?: string;
    license?: string | string[];
    system?: string;
    parameters?: Record<string, unknown>;
    messages?: Record<string, unknown>[];
    stream?: boolean;
    quantize?: string;
}
export interface OllamaCopyRequest {
    source: string;
    destination: string;
}
export interface OllamaPushRequest {
    model: string;
    insecure?: boolean;
    stream?: boolean;
}
export interface OllamaEmbeddingsRequest {
    model: string;
    input: string | string[];
    truncate?: boolean;
    options?: Record<string, unknown>;
    keep_alive?: string;
}
export interface OllamaEmbeddingsResponse {
    embeddings: number[][];
}
export interface ApiResponse<T = unknown> {
    success: boolean;
    data?: T;
    error?: string;
    message?: string;
}
export interface OllamaLegacyEmbeddingsRequest {
    model: string;
    prompt: string;
    options?: Record<string, unknown>;
    keep_alive?: string;
}
export interface OllamaLegacyEmbeddingsResponse {
    embedding: number[];
}
export interface Document {
    id: string;
    filename: string;
    content: string;
    fileType: 'pdf' | 'txt';
    size: number;
    sessionId?: string;
    uploadedAt: number;
}
export interface DocumentChunk {
    id: string;
    documentId: string;
    content: string;
    chunkIndex: number;
    startChar: number;
    endChar: number;
    embedding?: number[];
}
export interface PluginAuthConfig {
    header: string;
    prefix?: string;
    key_env: string;
}
export type PluginType = 'completion' | 'embedding' | 'chat' | 'tts' | 'stt' | 'image';
export interface TTSConfig {
    voices?: string[];
    default_voice?: string;
    formats?: string[];
    default_format?: string;
    max_characters?: number;
    supports_streaming?: boolean;
}
export interface ImageGenConfig {
    sizes?: string[];
    default_size?: string;
    qualities?: string[];
    default_quality?: string;
    styles?: string[];
    default_style?: string;
    max_prompt_length?: number;
    supports_n?: boolean;
    max_n?: number;
}
export interface PluginCapabilities {
    completion?: {
        endpoint: string;
        model_map: string[];
    };
    tts?: {
        endpoint: string;
        model_map: string[];
        config?: TTSConfig;
    };
    stt?: {
        endpoint: string;
        model_map: string[];
    };
    embedding?: {
        endpoint: string;
        model_map: string[];
    };
    image?: {
        endpoint: string;
        model_map: string[];
        config?: ImageGenConfig;
    };
}
export type PluginVariableType = 'string' | 'number' | 'boolean' | 'select';
export interface PluginVariableDefinition {
    name: string;
    type: PluginVariableType;
    label: string;
    description?: string;
    default?: string | number | boolean;
    required?: boolean;
    sensitive?: boolean;
    options?: string[];
    min?: number;
    max?: number;
}
export interface Plugin {
    id: string;
    name: string;
    type: PluginType;
    endpoint: string;
    auth: PluginAuthConfig;
    model_map: string[];
    capabilities?: PluginCapabilities;
    variables?: PluginVariableDefinition[];
    active?: boolean;
    created_at?: number;
    updated_at?: number;
}
export interface TTSRequest {
    model: string;
    input: string;
    voice?: string;
    response_format?: 'mp3' | 'opus' | 'aac' | 'flac' | 'wav' | 'pcm';
    speed?: number;
}
export interface TTSResponse {
    audio: Buffer;
    format: string;
    model: string;
    voice: string;
}
export interface ImageGenRequest {
    model: string;
    prompt: string;
    size?: string;
    quality?: string;
    style?: string;
    n?: number;
    response_format?: 'url' | 'b64_json';
}
export interface ImageGenResponse {
    images: Array<{
        url?: string;
        b64_json?: string;
        revised_prompt?: string;
    }>;
    model: string;
}
export interface GeneratedImage {
    id: string;
    userId: string;
    prompt: string;
    model: string;
    imageData: string;
    size?: string;
    quality?: string;
    createdAt: number;
}
export interface PluginStatus {
    id: string;
    active: boolean;
    available: boolean;
    last_used?: number;
}
export interface PluginRequest {
    plugin_id: string;
    model: string;
    messages: ChatMessage[];
    options?: GenerationOptions;
}
export interface PluginResponse {
    id: string;
    object: string;
    created: number;
    model: string;
    choices: {
        index: number;
        message: {
            role: string;
            content: string;
        };
        finish_reason: string;
    }[];
    usage?: {
        prompt_tokens: number;
        completion_tokens: number;
        total_tokens: number;
    };
}
export interface User {
    id: string;
    username: string;
    email?: string;
    password_hash?: string;
    role: 'admin' | 'user';
    avatar?: string | null;
    created_at: number;
    updated_at: number;
}
export interface UserCreateRequest {
    username: string;
    email?: string;
    password: string;
    role?: 'admin' | 'user';
    avatar?: string | null;
}
export interface UserUpdateRequest {
    username?: string;
    email?: string;
    role?: 'admin' | 'user';
    avatar?: string | null;
}
export interface LoginRequest {
    username: string;
    password: string;
}
export interface LoginResponse {
    user: Omit<User, 'password_hash'>;
    token: string;
    refreshToken?: string;
}
export interface ChangePasswordRequest {
    currentPassword: string;
    newPassword: string;
}
export interface ResetPasswordRequest {
    userId: string;
    newPassword: string;
}
export declare const getErrorMessage: (error: unknown, fallback: string) => string;
export interface PersonaParameters {
    temperature?: number;
    top_p?: number;
    top_k?: number;
    context_window?: number;
    max_tokens?: number;
    system_prompt?: string;
    repeat_penalty?: number;
    presence_penalty?: number;
    frequency_penalty?: number;
}
export interface AdvancedFeatures {
    embedding_model?: string;
    memory_settings?: {
        enabled: boolean;
        max_memories: number;
        auto_cleanup: boolean;
        retention_days: number;
    };
    mutation_settings?: {
        enabled: boolean;
        sensitivity: 'low' | 'medium' | 'high';
        auto_adapt: boolean;
    };
}
export interface Persona extends AdvancedFeatures {
    id: string;
    user_id: string;
    name: string;
    description?: string;
    model: string;
    parameters: PersonaParameters;
    avatar?: string;
    background?: string;
    created_at: number;
    updated_at: number;
}
export interface CreatePersonaRequest extends AdvancedFeatures {
    name: string;
    description?: string;
    model: string;
    parameters: PersonaParameters;
    avatar?: string;
    background?: string;
}
export interface UpdatePersonaRequest extends Partial<AdvancedFeatures> {
    name?: string;
    description?: string;
    model?: string;
    parameters?: PersonaParameters;
    avatar?: string;
    background?: string;
}
export interface PersonaExport extends AdvancedFeatures {
    name: string;
    description?: string;
    model: string;
    params: PersonaParameters;
    avatar?: string;
    background?: string;
    exportedAt: number;
    version: string;
}
export interface EmbeddingModel {
    id: string;
    name: string;
    description: string;
    provider: 'ollama' | 'openai' | 'sentence-transformers' | 'huggingface';
    dimensions: number;
}
export interface PersonaMemoryEntry {
    id: string;
    user_id: string;
    persona_id: string;
    content: string;
    embedding?: number[];
    timestamp: number;
    context?: string;
    importance_score?: number;
}
export interface PersonaState {
    persona_id: string;
    user_id: string;
    runtime_state: Record<string, unknown>;
    mutation_log: PersonaMutation[];
    last_updated: number;
    version: number;
}
export interface PersonaMutation {
    id: string;
    timestamp: number;
    type: 'memory_add' | 'memory_update' | 'state_change' | 'parameter_adjust';
    description: string;
    changes: Record<string, unknown>;
    triggered_by?: string;
}
export interface MemorySearchResult {
    entry: PersonaMemoryEntry;
    similarity_score: number;
    relevance_rank: number;
}
export interface MutationEngineResult {
    state_deltas: Record<string, unknown>;
    new_memories: Omit<PersonaMemoryEntry, 'id' | 'timestamp'>[];
    updated_memories: {
        id: string;
        updates: Partial<PersonaMemoryEntry>;
    }[];
    mutations: Omit<PersonaMutation, 'id' | 'timestamp'>[];
}
export interface PersonaBackup {
    persona: Persona;
    state: PersonaState;
    memories: PersonaMemoryEntry[];
    created_at: number;
    version: string;
}
export interface PersonaDNA {
    persona: Persona;
    state: PersonaState;
    memories: PersonaMemoryEntry[];
    mutation_log: PersonaMutation[];
    export_metadata: {
        exported_at: number;
        user_id: string;
        version: string;
        checksum: string;
    };
}
export interface MemoryStatus {
    status: 'active' | 'wiped' | 'backed_up';
    memory_count: number;
    last_backup?: number;
    size_mb: number;
}
//# sourceMappingURL=index.d.ts.map