fix: chat accepts quotes now

This commit is contained in:
gosangam
2026-08-29 11:58:33 +05:30
parent 028a8d7e1c
commit 76cd106ef7
11 changed files with 559 additions and 41 deletions
+17 -1
View File
@@ -168,7 +168,8 @@ export type AttachmentKind =
| "audio"
| "file"
| "link"
| "entity";
| "entity"
| "quote";
export type Attachment = {
id: string;
@@ -259,6 +260,7 @@ export const chat = {
replyToId?: string;
previewUrl?: string;
attachments?: UploadedAttachment[];
quote?: QuotePayload;
},
) =>
call<ChatMessage>(`/chat/conversations/${conversationId}/messages`, {
@@ -270,6 +272,7 @@ export const chat = {
// Only the URL: the BFF fetches the card's contents itself.
preview_url: opts?.previewUrl ?? null,
attachments: opts?.attachments ?? [],
quote: opts?.quote ?? null,
}),
}),
@@ -399,6 +402,19 @@ export const chat = {
};
/** A file already uploaded to the private bucket, ready to attach on send. */
/**
* A passage shared from the library.
*
* `path` is app-relative on purpose — the BFF refuses anything absolute or
* protocol-relative, because a quote renders as trusted in-app content and
* must not be able to carry the reader off-site.
*/
export type QuotePayload = {
path: string;
title: string;
text: string;
};
export type UploadedAttachment = {
key: string;
mime: string;