import ' rollup-plugin-inject-process-env';
/**
 * This mirrors the declaration in Chat-Server
 */
import { ChatUserInfo } from "@xapp/stentor-chat-widget";
import { Display } from "stentor-models";
/**
 * It's the same request in both (visitor <-> agent) direction!
 */
export interface ChatMessageRequest {
    /**
     * Type of message
     */
    type: "rating" | "ratingRequest" | "comment" | "msg" | "failureMsg" | "custom" | "startTyping" | "stopTyping" | "userJoined" | "userLeft" | "handOff" | "handBack" | "permissionRequest" | "permissionGrant";
    timestamp: number;
    msg?: ChatServerMessage;
    /**
     * Information related to the user sending the request
     */
    readonly user: ChatUserInfo;
    agent?: boolean;
    /**
     * The user has requested to end the session.
     */
    endSession?: boolean;
    handoffMessage?: string;
    handoffTarget?: string;
    /**
     * Optional, open ended, attributes to append to each request.
     */
    attributes?: Record<string, unknown>;
}
export type PermissionRequestType = "EMAIL" | "PHONE_NUMBER" | "LOCATION_PRECISE";
export interface PermissionRequest {
    readonly time: number;
    readonly type: PermissionRequestType;
    readonly approve?: ChatServerMessage;
    readonly deny?: ChatServerMessage;
}
export interface ChatMessageRequestCustom extends ChatMessageRequest {
    readonly type: "custom";
    readonly payload: string;
}
/**
 * A source reference for a chat message (MCP only).
 * Rendered as small links below the message bubble.
 */
export interface ChatSource {
    /** Display text for the source link */
    readonly title: string;
    /** URL to open when clicked */
    readonly url: string;
    /** Whether to open in new tab (default: true) */
    readonly newTab?: boolean;
}
export interface ChatServerMessage {
    readonly text?: string;
    readonly html?: string;
    readonly permissionRequest?: PermissionRequest;
    options?: (string | ChatServerActionLink)[];
    card?: ChatServerCard;
    list?: ChatServerList;
    token?: string;
    location?: ChatServerLocation;
    displays?: readonly Display[];
    context?: readonly string[];
    /**
     * Optional, open ended, attributes to append to each request.
     */
    attributes?: Record<string, unknown>;
    /**
     * Source references for the message (MCP only).
     * Rendered as compact links below the message bubble.
     */
    sources?: readonly ChatSource[];
}
export interface ChatServerLocation {
    readonly latitude: number;
    readonly longitude: number;
}
export interface ChatServerCard {
    title?: string;
    imageUrl?: string;
    imageActionUrl?: string;
    content?: string;
    buttons?: ChatServerButton[];
}
export type ChatServerListType = "LIST" | "CAROUSEL";
export interface ChatServerList {
    readonly type: ChatServerListType;
    readonly title?: string;
    readonly items: readonly ChatServerListItem[];
}
export interface ChatServerButton {
    actionUrl: string | null;
    label: string;
}
export interface ChatServerActionLink {
    actionUrl: string;
    label: string;
}
export declare function isChatServerActionLink(arg: string | ChatServerActionLink): arg is ChatServerActionLink;
export declare function getChatServerActionLinkLabel(arg: string | ChatServerActionLink): string;
export declare function getItemUrl(item: ChatServerListItem): string | null;
export interface ChatServerListItem {
    title: string;
    url?: string;
    imageUrl?: string;
    imageActionUrl?: string;
    subTitle?: string;
    token?: string;
    buttons?: readonly ChatServerButton[];
    /**
     * When true, hides the URL text and external link icon while
     * still allowing the item to be clickable.
     *
     * @example
     * { title: "Visit Site", imageActionUrl: "https://example.com", hideUrl: true }
     */
    hideUrl?: boolean;
}
