import { HttpClient } from '@angular/common/http'; import { ReplaySubject, Observable, BehaviorSubject } from 'rxjs'; import * as i0 from "@angular/core"; export interface Assistant { deleted: boolean; } /** * ✅ AssistantStep - Étape d'exécution d'un agent */ export interface AssistantStep { description: string; tool?: string; status?: 'pending' | 'running' | 'completed' | 'error'; result?: any; } /** * ✅ Usage - Statistiques d'utilisation des tokens */ export interface Usage { prompt: number; completion: number; cost: number; total: number; } /** * ✅ AssistantState - État de l'assistant pour la gestion UI */ export interface AssistantState { status: 'init' | 'prompt' | 'running' | 'end' | 'error'; usage?: Usage; agent?: string; content?: string; steps?: AssistantStep[]; error?: string; thinking?: boolean; } /** * ✅ AssistantMessage - Message dans la discussion */ export interface AssistantMessage { id: string; role: 'user' | 'assistant'; content: string; timestamp: Date; steps?: AssistantStep[]; } /** * ✅ ClientDiscussion - Discussion complète avec l'assistant */ export interface ClientDiscussion { id: string | null; messages: AssistantMessage[]; usage: Usage; agent?: string; createdAt: Date; updatedAt: Date; } /** * ✅ Extract steps from a message content */ export declare function parseSteps(message: string): AssistantStep[]; export declare class AssistantService { private $http; assistant$: ReplaySubject; assistants$: BehaviorSubject | ReplaySubject; config: any; private defaultUsage; private defaultState; private discussionSubject; private stateSubject; private transcriptionsSubject; private memoriesSubject; private promptEventSubject; discussion$: Observable; state$: Observable; transcriptions$: Observable; memories$: Observable; promptEvt$: Observable; private cache; private headers; private defaultConfig; constructor($http: HttpClient); get discussion(): ClientDiscussion; get discussionMessages(): AssistantMessage[]; get state(): AssistantState; private deleteCache; private updateCache; /** * ✅ Clean text from thinking and step tags */ private cleanText; /** * ✅ Update state with partial values */ updateState(partial: Partial): void; /** * ✅ Cross-component prompt communication + chat trigger */ sendPrompt(prompt: string, options?: { agent?: string; ragname?: string; thinking?: boolean; }): Observable; /** * ✅ Get history from server */ history(opts?: any): Observable; /** * ✅ Delete a message from history */ historyDel(messageId: string, agent?: string): Observable; /** * ✅ Get memories from RAG */ memories(): Observable; /** * ✅ Delete a memory from RAG */ memoryDel(id: string): Observable; /** * ✅ Add temporary user message to discussion */ private addTemporaryUserMessage; /** * ✅ Create temporary assistant message at start of streaming */ private createTemporaryAssistantMessage; /** * ✅ Update existing temporary assistant message */ private updateTemporaryAssistantMessage; chat(params: any): Observable; /** * ✅ Whisper transcription API */ whisper(state: { blob?: Blob; chunk?: Blob; type?: string; silent?: boolean; previousText?: string; }): Observable; /** * ✅ Abort current operation */ abort(): void; /** * ✅ Send message via email */ message(content: string, subject?: string, audioContext?: { audioUrl?: string; transcription?: string; cartUrl?: string; }): Observable; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } //# sourceMappingURL=assistant.service.d.ts.map