import type { ComputedRef, DeepReadonly, Ref } from 'vue';
export interface MaChatbotPluginOptions {
    agentApiUrl: string;
    gatewayUrl: string;
    getAccessToken: () => string;
    refreshToken?: () => Promise<void>;
    isTokenExpiring: () => boolean;
    onAuthError?: (error: Error) => void;
}
export type MaChatbotFeedbackTopic = string;
export type MaChatbotMessageRole = 'user' | 'assistant';
export type MaChatbotMessageStatus = 'success' | 'error' | 'guardrail' | 'timeout';
export interface MaChatbotMessage {
    id: string;
    role: MaChatbotMessageRole;
    content: string;
    timestamp?: Date;
    status?: MaChatbotMessageStatus;
    recordId?: number;
    feedback?: boolean;
    feedbackTopic?: MaChatbotFeedbackTopic;
    feedbackText?: string;
}
export type ErrorIconVariant = 'amber' | 'red';
export interface FeedbackSubmitPayload {
    topic: MaChatbotFeedbackTopic | null;
    text: string;
}
export type MaChatbotSuggestedPrompt = string;
export type MaChatbotEventType = 'model_id' | 'model_params' | 'agent_response' | 'guardrail_violation' | 'error' | 'request_time' | 'usage';
export interface MaChatbotStreamEvent {
    type: MaChatbotEventType;
    data: unknown;
    stage?: string;
}
export interface MaChatbotGuardrailViolation {
    guard: string;
    stage?: string;
}
export interface MaChatbotTokenUsage {
    input_tokens: number;
    output_tokens: number;
    total_tokens: number;
}
export interface MaChatbotStreamMetadata {
    modelId?: string;
    usage?: MaChatbotTokenUsage;
    requestTime?: number;
}
export interface SendMessageOptions {
    prompt: string;
    maOrgId?: string;
    onToken?: (token: string) => void;
    onDone?: () => void;
    onError?: (errorMessage: string) => void;
    onGuardrailViolation?: (violation: MaChatbotGuardrailViolation) => void;
    onStreamMetadata?: (metadata: MaChatbotStreamMetadata) => void;
}
export interface ChatbotSessionResponse {
    success: boolean;
    data: {
        id: number;
        sessionId?: string;
        userInput: string;
        aiResponse: string;
        model: string;
        requestTime: number;
        inputTokenUsage: number;
        outputTokenUsage: number;
        createdAt: string;
        isPositive?: boolean;
        feedbackTopic?: string;
        feedbackText?: string;
    };
}
export interface MaChatbotMessageSentPayload {
    message: string;
}
export interface MaChatbotFeedbackSentPayload {
    recordId: number;
    isPositive: boolean;
    feedbackTopic?: string;
    feedbackText?: string;
}
export interface MaChatbotInstance {
    isLoading: DeepReadonly<Ref<boolean>>;
    error: DeepReadonly<Ref<string | null>>;
    guardrailViolation: DeepReadonly<Ref<MaChatbotGuardrailViolation | null>>;
    sessionId: string;
    sendMessage: (options: SendMessageOptions) => Promise<MaChatbotStreamMetadata>;
    stopStream: () => void;
    logSession: (userInput: string, aiResponse: string, model: string, inputTokenUsage: number, outputTokenUsage: number, requestTime: number, inputCreatedAt: Date, outputCreatedAt: Date) => Promise<number | null>;
    submitFeedback: (recordId: number, isPositive: boolean, feedbackTopic?: string, feedbackText?: string) => Promise<boolean>;
}
export interface MaChatbotExposed {
    messages: Ref<MaChatbotMessage[]>;
    sendMessage: () => Promise<void>;
    stopStream: () => void;
    isBusy: ComputedRef<boolean>;
    error: DeepReadonly<Ref<string | null>>;
    showFeedbackPanel: Ref<boolean>;
}
