/**
 * BuddyManager — Core state machine for the buddy companion.
 *
 * Handles: bone rolling, soul generation, persistence, Ollama availability checks.
 * Bones are deterministic from hash(username + hostname + salt + rerollCount).
 * Soul is LLM-generated once on first hatch and persisted to buddy.json.
 */
import type { Model } from "@dreb/ai";
import type { BuddyState } from "./buddy-types.js";
export interface OllamaStatus {
    available: boolean;
    models: string[];
    error?: string;
}
/**
 * Check if Ollama is running and has models available.
 * Uses the /api/tags endpoint.
 */
export declare function checkOllama(): Promise<OllamaStatus>;
/**
 * Truncate response to a maximum word count, appending "...[truncated]" if exceeded.
 */
export declare function truncateResponse(text: string, maxWords: number): string;
export declare class BuddyManager {
    private state;
    private ollamaStatus;
    /** Get current buddy state (null if not loaded) */
    getState(): BuddyState | null;
    /** Check if buddy exists on disk */
    hasStoredBuddy(): boolean;
    /**
     * Load or create buddy state.
     * If stored buddy exists, loads soul and re-rolls bones.
     * If no stored buddy, returns null (need to hatch first).
     */
    load(): BuddyState | null;
    /**
     * Hatch a new buddy. Generates bones, then uses parent LLM for soul.
     * Returns the new state.
     */
    hatch(parentModel: Model<"openai-completions">, apiKey: string): Promise<BuddyState>;
    /**
     * Reroll the buddy — new bones + new soul.
     */
    reroll(parentModel: Model<"openai-completions">, apiKey: string): Promise<BuddyState>;
    /** Get buddy's name (for name-call detection) */
    getName(): string | null;
    private ollamaChat;
    /**
     * Generate a reaction to an event using Ollama.
     * Returns null if Ollama is unavailable.
     */
    react(event: string): Promise<string | null>;
    /**
     * Respond to the user calling the buddy's name.
     * Uses Ollama for the response.
     */
    respondToNameCall(userMessage: string, recentContext: string): Promise<string | null>;
    /** Get the configured Ollama model name, or null if not set */
    getOllamaModel(): string | null;
    /** Set the Ollama model for buddy reactions. Persists to disk. */
    setOllamaModel(modelName: string): void;
    /** Reset Ollama status cache (e.g. after detecting it became available) */
    resetOllamaCache(): void;
    /** Update the hidden flag in persisted storage */
    setHidden(hidden: boolean): void;
}
//# sourceMappingURL=buddy-manager.d.ts.map