import type { AiMessage, AssistantInitConfig, AssistantReplyOptions, AssistantResult, ConversationStore, IAssistantService } from "../../types/index.js"; /** * Creates a fresh in-memory conversation store. * Useful in tests or when you want an isolated store per process. * * @returns A {@link ConversationStore} backed by a Map. */ export declare function useCreateMemoryStore(): ConversationStore; /** * AssistantService - Singleton para el asistente conversacional. * * Aplica el patrón Singleton: una única instancia mantiene el store de * conversaciones, las herramientas y el presupuesto de pasos del agente. * El store es intercambiable (Strategy implícita: in-memory por defecto, * Prisma u otro persistente vía `useInit`), y la lógica de completado * delega en {@link AgentService}. * * @example * ```ts * const assistant = AssistantService.getInstance(); * assistant.useInit({ model: "qwen3.8-max" }); * const result = await assistant.useReply(undefined, "Hello!"); * ``` */ export declare class AssistantService implements IAssistantService { private static instance; /** Conversation store. Defaults to in-memory. */ private store; /** Tools used by {@link useReply} when none are passed per call. */ private tools; /** Agent step budget. */ private maxSteps; /** * Constructor privado - enforce singleton. */ private constructor(); /** * Obtiene la instancia única del AssistantService (Singleton). * * @returns La instancia única de {@link AssistantService}. */ static getInstance(): AssistantService; /** * Configures the assistant: provider (Kitt) plus an optional conversation store. * * Defaults mirror `useInitAgent`: `apiKey` falls back to * `process.env.DASHSCOPE_API_KEY`, and `baseUrl`/`model`/`systemPrompt` fall * back to the Kitt preset. The default store is in-memory; pass * `{ store }` to persist conversations (e.g. a Prisma-backed store). * * @param config - Assistant configuration. * * @example * ```ts * AssistantService.getInstance().useInit({ model: "qwen3.8-max" }); * ``` */ useInitAssistant(config?: AssistantInitConfig): void; /** * Creates a new conversation session. * * @param channel - Optional channel tag (e.g. `"rest"`, `"telegram"`, `"whatsapp"`). * @returns The new session id. */ useCreateSession(channel?: string): Promise; /** * Checks whether a conversation session exists. * * @param sessionId - The conversation session id. * @returns `true` when the session exists. */ useSessionExists(sessionId: string): Promise; /** * Returns the full message history of a session, oldest first. * * @param sessionId - The conversation session id. * @returns The accumulated messages. */ useGetHistory(sessionId: string): Promise; /** * Deletes a conversation session and its messages. * * @param sessionId - The conversation session id to reset. */ useResetSession(sessionId: string): Promise; /** * Sends a user message within a conversation and returns the assistant reply. * If no `sessionId` is provided, a new session is created. The user message and * the assistant reply are persisted only on success. * * @param sessionId - Existing session id, or `undefined` to start a new one. * @param text - The user's message. * @param options - Optional completion options. * @returns An {@link AssistantResult} with the reply and session id. * * @example * ```ts * const result = await AssistantService.getInstance().useReply(undefined, "Hello!"); * if (result.ok) console.log(result.data.reply); * ``` */ useReply(sessionId: string | undefined, text: string, options?: AssistantReplyOptions): Promise; } /** * Configures the assistant: provider (Kitt) plus an optional conversation store. * * @param config - Assistant configuration. * * @example * ```ts * import { useInitAssistant } from "katanakit-js"; * * useInitAssistant({ model: "qwen3.8-max" }); * ``` */ export declare function useInitAssistant(config?: AssistantInitConfig): void; /** * Creates a new conversation session. * * @param channel - Optional channel tag (e.g. `"rest"`, `"telegram"`, `"whatsapp"`). * @returns The new session id. * * @example * ```ts * const sessionId = await useCreateSession("rest"); * ``` */ export declare function useCreateSession(channel?: string): Promise; /** * Checks whether a conversation session exists. * * @param sessionId - The conversation session id. * @returns `true` when the session exists. * * @example * ```ts * const exists = await useSessionExists(sessionId); * ``` */ export declare function useSessionExists(sessionId: string): Promise; /** * Returns the full message history of a session, oldest first. * * @param sessionId - The conversation session id. * @returns The accumulated messages. * * @example * ```ts * const history = await useGetHistory(sessionId); * ``` */ export declare function useGetHistory(sessionId: string): Promise; /** * Deletes a conversation session and its messages. * * @param sessionId - The conversation session id to reset. * * @example * ```ts * await useResetSession(sessionId); * ``` */ export declare function useResetSession(sessionId: string): Promise; /** * Sends a user message within a conversation and returns the assistant reply. * If no `sessionId` is provided, a new session is created. The user message and * the assistant reply are persisted only on success. * * @param sessionId - Existing session id, or `undefined` to start a new one. * @param text - The user's message. * @param options - Optional completion options. * @returns An {@link AssistantResult} with the reply and session id. * * @example * ```ts * import { useReply } from "katanakit-js"; * * const result = await useReply(undefined, "How do I reset my password?"); * if (result.ok) console.log(result.data.reply); * ``` */ export declare function useReply(sessionId: string | undefined, text: string, options?: AssistantReplyOptions): Promise; /** Object facade implementing {@link IAssistantService} over the singleton. */ export declare const assistant: IAssistantService; //# sourceMappingURL=assistant.service.d.ts.map