@alxxsck/ai-assistant 2.22.3 → 2.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,20 +12,22 @@ export type WidgetConfig = {
12
12
  /** Enables verbose `[Lola-Widget]` diagnostics. Errors are always logged. */
13
13
  debug?: boolean;
14
14
  /**
15
- * Enables the attachment composer. Without a transport the SDK uses its
16
- * local mock transport, intended for visual QA and staged integration.
15
+ * Configures the attachment composer. Attachments use Lola Backend by
16
+ * default; set `enabled: false` to hide them or pass a custom transport for
17
+ * controlled demos and tests.
17
18
  */
18
19
  attachments?: {
19
20
  enabled?: boolean;
20
- /** Turns on attachmentIds only after the receiving backend contract ships. */
21
+ /** Sends READY ids by default. Set false only for a legacy backend. */
21
22
  sendAttachmentIds?: boolean;
22
23
  maxFiles?: number;
23
24
  maxBytes?: number;
25
+ maxTotalBytes?: number;
24
26
  transport?: ChatAttachmentTransport;
25
27
  };
26
28
  /** Optional product integrations for navigation, modals, and highlighting. */
27
29
  handlers?: HostCommandHandlers;
28
30
  };
29
31
  export type { CustomerInteractionSession };
30
- export type { ChatAttachment, ChatAttachmentTransport, ChatAttachmentUploadInput, } from "./domain/message/chat-experience";
32
+ export type { ChatAttachment, ChatAttachmentAccessInput, ChatAttachmentGrant, ChatAttachmentTransport, ChatAttachmentUploadInput, ChatAttachmentUploadStage, } from "./domain/message/chat-experience";
31
33
  export type { CommandEventDetail, HighlightCommandContext, HostCommandHandlers, OpenModalContext, OpenPageContext, } from "./domain/command/command.types";
@@ -0,0 +1,10 @@
1
+ import type { ChatAttachment, ChatAttachmentTransport } from "@/domain/message/chat-experience";
2
+ export type AttachmentPreviewKind = "image" | "pdf";
3
+ export declare const formatAttachmentSize: (size: number) => string;
4
+ export declare const attachmentPreviewKind: (attachment: Pick<ChatAttachment, "mediaType">) => AttachmentPreviewKind | null;
5
+ export declare const hasExpectedAttachmentSignature: (mediaType: string, bytes: Uint8Array) => boolean;
6
+ export declare const createVerifiedAttachmentPreviewUrl: (url: string, attachment: Pick<ChatAttachment, "mediaType" | "size">, signal?: AbortSignal) => Promise<string>;
7
+ export declare const createVerifiedLocalImagePreviewUrl: (file: File, mediaType: string) => Promise<string>;
8
+ export declare const safeGrantedAttachmentUrl: (raw: string) => string;
9
+ export declare const resolveChatAttachmentUrl: (attachment: ChatAttachment, conversationId: string | undefined, transport: ChatAttachmentTransport) => Promise<string>;
10
+ export declare const downloadChatAttachment: (attachment: ChatAttachment, conversationId: string | undefined, transport: ChatAttachmentTransport) => Promise<void>;
@@ -1,8 +1,10 @@
1
1
  import type { ChatAttachment } from "@/domain/message/chat-experience";
2
2
  type ChatAttachmentListProps = {
3
3
  attachments: readonly ChatAttachment[];
4
+ onPreview?: (attachment: ChatAttachment) => void;
5
+ onDownload?: (attachment: ChatAttachment) => void;
4
6
  };
5
- export declare function ChatAttachmentList({ attachments }: ChatAttachmentListProps): import("react/jsx-runtime").JSX.Element | null;
7
+ export declare function ChatAttachmentList({ attachments, onPreview, onDownload, }: ChatAttachmentListProps): import("react/jsx-runtime").JSX.Element | null;
6
8
  export declare function ChatAttachmentPlaceholder({ fileName }: {
7
9
  fileName: string;
8
10
  }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import type { ChatAttachment, ChatAttachmentTransport } from "@/domain/message/chat-experience";
2
+ type ChatAttachmentPreviewDialogProps = {
3
+ attachment: ChatAttachment | null;
4
+ conversationId?: string;
5
+ transport: ChatAttachmentTransport;
6
+ onClose: () => void;
7
+ };
8
+ export declare function ChatAttachmentPreviewDialog({ attachment, conversationId, transport, onClose, }: ChatAttachmentPreviewDialogProps): import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -1,8 +1,11 @@
1
1
  import { type MessageData } from "@/api/messages.api.types";
2
2
  import { type ComponentProps } from "react";
3
+ import type { ChatAttachment } from "@/domain/message/chat-experience";
3
4
  export type MessageAuthor = "me" | "them";
4
5
  type ChatMessageProps = ComponentProps<"div"> & {
5
6
  message: MessageData;
7
+ onPreviewAttachment?: (attachment: ChatAttachment, conversationId: string) => void;
8
+ onDownloadAttachment?: (attachment: ChatAttachment, conversationId: string) => void;
6
9
  };
7
10
  export declare const ChatMessage: import("react").NamedExoticComponent<ChatMessageProps>;
8
11
  export {};
@@ -1,6 +1,9 @@
1
1
  import type { PendingCustomerMessage } from "@/domain/message/message.store";
2
+ import type { ChatAttachment } from "@/domain/message/chat-experience";
2
3
  type OptimisticCustomerMessageProps = {
3
4
  message: PendingCustomerMessage;
5
+ onPreviewAttachment?: (attachment: ChatAttachment, conversationId?: string) => void;
6
+ onDownloadAttachment?: (attachment: ChatAttachment, conversationId?: string) => void;
4
7
  };
5
- export declare function OptimisticCustomerMessage({ message, }: OptimisticCustomerMessageProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare function OptimisticCustomerMessage({ message, onPreviewAttachment, onDownloadAttachment, }: OptimisticCustomerMessageProps): import("react/jsx-runtime").JSX.Element;
6
9
  export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@alxxsck/ai-assistant",
3
3
  "private": false,
4
- "version": "2.22.3",
4
+ "version": "2.23.0",
5
5
  "description": "Embeddable Lola AI assistant library",
6
6
  "type": "module",
7
7
  "main": "dist/bridge-ai-chat-widget.es.js",