@salmonui/chat 0.0.0-stage → 0.3.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.
Files changed (103) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +41 -2
  3. package/dist/conversation/Conversation.d.ts +4 -0
  4. package/dist/conversation/Conversation.d.ts.map +1 -0
  5. package/dist/conversation/Conversation.js +588 -0
  6. package/dist/conversation/Conversation.js.map +1 -0
  7. package/dist/conversation/Item.d.ts +67 -0
  8. package/dist/conversation/Item.d.ts.map +1 -0
  9. package/dist/conversation/Item.js +149 -0
  10. package/dist/conversation/Item.js.map +1 -0
  11. package/dist/conversation/assistant-lazy.d.ts +6 -0
  12. package/dist/conversation/assistant-lazy.d.ts.map +1 -0
  13. package/dist/conversation/assistant-lazy.js +16 -0
  14. package/dist/conversation/assistant-lazy.js.map +1 -0
  15. package/dist/conversation/assistant-static.d.ts +4 -0
  16. package/dist/conversation/assistant-static.d.ts.map +1 -0
  17. package/dist/conversation/assistant-static.js +9 -0
  18. package/dist/conversation/assistant-static.js.map +1 -0
  19. package/dist/conversation/assistant-types.d.ts +2 -0
  20. package/dist/conversation/assistant-types.d.ts.map +1 -0
  21. package/dist/conversation/assistant-types.js +3 -0
  22. package/dist/conversation/assistant-types.js.map +1 -0
  23. package/dist/conversation/assistant.d.ts +54 -0
  24. package/dist/conversation/assistant.d.ts.map +1 -0
  25. package/dist/conversation/assistant.js +348 -0
  26. package/dist/conversation/assistant.js.map +1 -0
  27. package/dist/conversation/context.d.ts +80 -0
  28. package/dist/conversation/context.d.ts.map +1 -0
  29. package/dist/conversation/context.js +40 -0
  30. package/dist/conversation/context.js.map +1 -0
  31. package/dist/conversation/format.d.ts +33 -0
  32. package/dist/conversation/format.d.ts.map +1 -0
  33. package/dist/conversation/format.js +150 -0
  34. package/dist/conversation/format.js.map +1 -0
  35. package/dist/conversation/parts.d.ts +16 -0
  36. package/dist/conversation/parts.d.ts.map +1 -0
  37. package/dist/conversation/parts.js +326 -0
  38. package/dist/conversation/parts.js.map +1 -0
  39. package/dist/conversation/runner.d.ts +15 -0
  40. package/dist/conversation/runner.d.ts.map +1 -0
  41. package/dist/conversation/runner.js +52 -0
  42. package/dist/conversation/runner.js.map +1 -0
  43. package/dist/conversation/store.d.ts +63 -0
  44. package/dist/conversation/store.d.ts.map +1 -0
  45. package/dist/conversation/store.js +142 -0
  46. package/dist/conversation/store.js.map +1 -0
  47. package/dist/conversation/types.d.ts +479 -0
  48. package/dist/conversation/types.d.ts.map +1 -0
  49. package/dist/conversation/types.js +5 -0
  50. package/dist/conversation/types.js.map +1 -0
  51. package/dist/conversation.css +788 -0
  52. package/dist/conversation.d.ts +18 -0
  53. package/dist/conversation.d.ts.map +1 -0
  54. package/dist/conversation.js +26 -0
  55. package/dist/conversation.js.map +1 -0
  56. package/dist/inline-assist/InlineAssist.d.ts +16 -0
  57. package/dist/inline-assist/InlineAssist.d.ts.map +1 -0
  58. package/dist/inline-assist/InlineAssist.js +384 -0
  59. package/dist/inline-assist/InlineAssist.js.map +1 -0
  60. package/dist/inline-assist/model.d.ts +40 -0
  61. package/dist/inline-assist/model.d.ts.map +1 -0
  62. package/dist/inline-assist/model.js +87 -0
  63. package/dist/inline-assist/model.js.map +1 -0
  64. package/dist/inline-assist/types.d.ts +222 -0
  65. package/dist/inline-assist/types.d.ts.map +1 -0
  66. package/dist/inline-assist/types.js +5 -0
  67. package/dist/inline-assist/types.js.map +1 -0
  68. package/dist/inline-assist.css +890 -0
  69. package/dist/inline-assist.d.ts +5 -0
  70. package/dist/inline-assist.d.ts.map +1 -0
  71. package/dist/inline-assist.js +12 -0
  72. package/dist/inline-assist.js.map +1 -0
  73. package/dist/internal/stream-run.d.ts +71 -0
  74. package/dist/internal/stream-run.d.ts.map +1 -0
  75. package/dist/internal/stream-run.js +161 -0
  76. package/dist/internal/stream-run.js.map +1 -0
  77. package/dist/internal/suggest.d.ts +96 -0
  78. package/dist/internal/suggest.d.ts.map +1 -0
  79. package/dist/internal/suggest.js +332 -0
  80. package/dist/internal/suggest.js.map +1 -0
  81. package/dist/smart-paste/fields.d.ts +31 -0
  82. package/dist/smart-paste/fields.d.ts.map +1 -0
  83. package/dist/smart-paste/fields.js +162 -0
  84. package/dist/smart-paste/fields.js.map +1 -0
  85. package/dist/smart-paste/useSmartPaste.d.ts +38 -0
  86. package/dist/smart-paste/useSmartPaste.d.ts.map +1 -0
  87. package/dist/smart-paste/useSmartPaste.js +56 -0
  88. package/dist/smart-paste/useSmartPaste.js.map +1 -0
  89. package/dist/smart-paste.d.ts +3 -0
  90. package/dist/smart-paste.d.ts.map +1 -0
  91. package/dist/smart-paste.js +6 -0
  92. package/dist/smart-paste.js.map +1 -0
  93. package/dist/styles.css +1754 -0
  94. package/dist/text-suggest/useTextSuggest.d.ts +13 -0
  95. package/dist/text-suggest/useTextSuggest.d.ts.map +1 -0
  96. package/dist/text-suggest/useTextSuggest.js +55 -0
  97. package/dist/text-suggest/useTextSuggest.js.map +1 -0
  98. package/dist/text-suggest.css +78 -0
  99. package/dist/text-suggest.d.ts +4 -0
  100. package/dist/text-suggest.d.ts.map +1 -0
  101. package/dist/text-suggest.js +9 -0
  102. package/dist/text-suggest.js.map +1 -0
  103. package/package.json +68 -4
@@ -0,0 +1,479 @@
1
+ import type { CSSProperties, ReactNode, Ref } from 'react';
2
+ import type { LocaleMessage } from '@salmonui/core/format';
3
+ import type { SpeechRecognizer } from '@salmonui/inputs/speech-to-text';
4
+ /** Delivery status of a message. */
5
+ export type ConversationMessageStatus = 'sending' | 'sent' | 'delivered' | 'read' | 'error';
6
+ /** A file attached to a message or pending in the composer. */
7
+ export interface ConversationAttachment {
8
+ /** Stable id (the upload transport's reference, or a generated id). */
9
+ readonly id: string;
10
+ readonly name: string;
11
+ /** Size in bytes. */
12
+ readonly size?: number;
13
+ /** MIME type. */
14
+ readonly type?: string;
15
+ /** Where the stored file can be opened (from the `upload` transport). */
16
+ readonly url?: string;
17
+ /** The picked file, when no `upload` transport stored it. */
18
+ readonly file?: File;
19
+ }
20
+ /** Quoted preview of a reply target that is not loaded. */
21
+ export interface ConversationReplyPreview {
22
+ readonly author: string;
23
+ readonly text: string;
24
+ }
25
+ export interface ConversationMessage {
26
+ /** Stable id: the list key and the store key. */
27
+ readonly id: string;
28
+ /** User id of the author. */
29
+ readonly author: string;
30
+ readonly text: string;
31
+ readonly createdAt?: Date | string | number;
32
+ readonly status?: ConversationMessageStatus;
33
+ /** Id of the message this one replies to. */
34
+ readonly replyTo?: string;
35
+ /** Preview of the reply target when it is not in `messages`. */
36
+ readonly replyPreview?: ConversationReplyPreview;
37
+ readonly pinned?: boolean;
38
+ readonly forwarded?: boolean;
39
+ /** User ids mentioned in `text` (rendered as mention tokens). */
40
+ readonly mentions?: readonly string[];
41
+ readonly attachments?: readonly ConversationAttachment[];
42
+ /** Assistant responses: reasoning and tool parts, in arrival order. */
43
+ readonly parts?: readonly ConversationResponsePart[];
44
+ /** Assistant responses: earlier responses to the same prompt, oldest first; `text` is the latest. */
45
+ readonly alternatives?: readonly string[];
46
+ /** Assistant responses: the user's rating. */
47
+ readonly feedback?: 'positive' | 'negative';
48
+ }
49
+ /** A non-text part of an assistant response; a plain string chunk is a text delta. */
50
+ export type ConversationResponsePart = {
51
+ readonly type: 'text';
52
+ readonly delta: string;
53
+ } | {
54
+ readonly type: 'reasoning';
55
+ readonly delta: string;
56
+ } | {
57
+ readonly type: 'tool';
58
+ readonly id: string;
59
+ readonly name: string;
60
+ readonly input: unknown;
61
+ readonly output?: unknown;
62
+ readonly status?: 'running' | 'done' | 'error';
63
+ };
64
+ /** A tool part. */
65
+ export type ConversationToolPart = Extract<ConversationResponsePart, {
66
+ readonly type: 'tool';
67
+ }>;
68
+ export interface ConversationUser {
69
+ readonly id: string;
70
+ readonly name: string;
71
+ /** Image URL or a node; initials of `name` otherwise. */
72
+ readonly avatar?: string | ReactNode;
73
+ /** Presence indicator next to the avatar. */
74
+ readonly status?: ReactNode;
75
+ }
76
+ /** What caused a change: the composer, a built-in action, a bot response or the API. */
77
+ export type ConversationChangeReason = 'send' | 'delete' | 'pin' | 'response' | 'retry' | 'regenerate' | 'feedback';
78
+ export interface ConversationChangeEvent {
79
+ readonly reason: ConversationChangeReason;
80
+ }
81
+ export interface ConversationSendEvent {
82
+ /** The message that is sent (cancellable in `onBeforeSend`). */
83
+ readonly message: ConversationMessage;
84
+ }
85
+ export interface ConversationBeforeSendEvent extends ConversationSendEvent {
86
+ /** Keeps the draft in the composer and sends nothing. */
87
+ preventDefault(): void;
88
+ readonly defaultPrevented: boolean;
89
+ }
90
+ export interface ConversationTypingEvent {
91
+ readonly typing: boolean;
92
+ }
93
+ /** Built-in message actions: chat and assistant items. */
94
+ export type ConversationBuiltInAction = 'copy' | 'reply' | 'pin' | 'delete' | 'edit' | 'regenerate' | 'feedback';
95
+ export interface ConversationCustomAction {
96
+ readonly id: string;
97
+ readonly label: string;
98
+ readonly icon?: ReactNode;
99
+ }
100
+ export type ConversationActionItem = ConversationBuiltInAction | ConversationCustomAction;
101
+ export interface ConversationItemActionEvent {
102
+ /** A built-in action (`'copy'`, `'reply'`, `'pin'`, `'delete'`, `'edit'`, `'regenerate'`, `'feedback'`) or a custom item's `id`. */
103
+ readonly action: string;
104
+ readonly message: ConversationMessage;
105
+ /** `'feedback'`: the rating the click sets (`undefined` clears it). */
106
+ readonly feedback?: 'positive' | 'negative' | undefined;
107
+ /** Cancels the built-in follow-up of a built-in action. */
108
+ preventDefault(): void;
109
+ readonly defaultPrevented: boolean;
110
+ }
111
+ export interface ConversationMentionUser {
112
+ readonly id: string;
113
+ readonly name: string;
114
+ }
115
+ /** A mention trigger of the composer, through the Dropdowns `Mention`. */
116
+ export interface ConversationMentionConfig {
117
+ /** Trigger character, `'@'` by default. */
118
+ readonly trigger?: string;
119
+ readonly items: readonly ConversationMentionUser[];
120
+ }
121
+ export interface ConversationMentionSelectEvent {
122
+ readonly user: ConversationMentionUser;
123
+ readonly trigger: string;
124
+ }
125
+ export interface ConversationBeforeMentionSelectEvent extends ConversationMentionSelectEvent {
126
+ preventDefault(): void;
127
+ readonly defaultPrevented: boolean;
128
+ }
129
+ /** Upload transport (the Inputs `FileUpload` contract shape). */
130
+ export type ConversationUploadTransport = (file: File, context: {
131
+ readonly signal: AbortSignal;
132
+ readonly onProgress: (loaded: number, total: number) => void;
133
+ }) => Promise<Partial<ConversationAttachment> | void>;
134
+ export interface ConversationAttachmentOptions {
135
+ /** The file input's `accept`. */
136
+ readonly accept?: string;
137
+ /** Largest accepted file in bytes. */
138
+ readonly maxSize?: number;
139
+ /** Most files per message. */
140
+ readonly maxCount?: number;
141
+ /** Where dropped files are accepted (default `'composer'`; `'none'` disables drag and drop). */
142
+ readonly dropTarget?: 'composer' | 'conversation' | 'none';
143
+ /** Stores a file before sending; without it, attachments carry the `File`. */
144
+ readonly upload?: ConversationUploadTransport;
145
+ /** Chip of a pending attachment in the composer. */
146
+ readonly renderPreview?: (context: {
147
+ readonly attachment: ConversationAttachment;
148
+ readonly progress: number | null;
149
+ readonly error: unknown;
150
+ readonly remove: () => void;
151
+ }) => ReactNode;
152
+ }
153
+ export interface ConversationBeforeAttachEvent {
154
+ readonly files: readonly File[];
155
+ preventDefault(): void;
156
+ readonly defaultPrevented: boolean;
157
+ }
158
+ export interface ConversationAttachEvent {
159
+ readonly attachments: readonly ConversationAttachment[];
160
+ }
161
+ export interface ConversationAttachmentEvent {
162
+ readonly attachment: ConversationAttachment;
163
+ /** The message that carries it; null for a pending composer attachment. */
164
+ readonly message: ConversationMessage | null;
165
+ }
166
+ /** A rejected file (too large, too many, wrong type) or a failed upload. */
167
+ export interface ConversationAttachmentError {
168
+ readonly file: File;
169
+ readonly reason: 'size' | 'count' | 'type' | 'upload';
170
+ readonly error?: unknown;
171
+ }
172
+ /**
173
+ * Bot and assistant replies: a Promise is one final
174
+ * response, an AsyncIterable streams text chunks and response parts. The
175
+ * `signal` aborts on Stop, `api.stop()`, a new send and unmount.
176
+ */
177
+ export type ConversationAdapter = (request: ConversationRequest, context: {
178
+ readonly signal: AbortSignal;
179
+ }) => Promise<string> | AsyncIterable<string | ConversationResponsePart>;
180
+ export interface ConversationRequest {
181
+ /** History including the new message. */
182
+ readonly messages: readonly ConversationMessage[];
183
+ readonly text: string;
184
+ readonly attachments: readonly ConversationAttachment[];
185
+ }
186
+ export interface ConversationLocaleText {
187
+ readonly feedLabel: LocaleMessage;
188
+ readonly composerLabel: LocaleMessage;
189
+ readonly placeholder: LocaleMessage;
190
+ readonly send: LocaleMessage;
191
+ readonly stop: LocaleMessage;
192
+ readonly attach: LocaleMessage;
193
+ readonly removeAttachment: LocaleMessage;
194
+ readonly jumpToLatest: LocaleMessage;
195
+ readonly unread: LocaleMessage;
196
+ readonly typingOne: LocaleMessage;
197
+ readonly typingTwo: LocaleMessage;
198
+ readonly typingMany: LocaleMessage;
199
+ readonly newMessage: LocaleMessage;
200
+ readonly responseComplete: LocaleMessage;
201
+ readonly messageActions: LocaleMessage;
202
+ readonly copy: LocaleMessage;
203
+ readonly reply: LocaleMessage;
204
+ readonly pin: LocaleMessage;
205
+ readonly unpin: LocaleMessage;
206
+ readonly delete: LocaleMessage;
207
+ readonly replyingTo: LocaleMessage;
208
+ readonly cancelReply: LocaleMessage;
209
+ readonly pinned: LocaleMessage;
210
+ readonly forwarded: LocaleMessage;
211
+ readonly status_sending: LocaleMessage;
212
+ readonly status_sent: LocaleMessage;
213
+ readonly status_delivered: LocaleMessage;
214
+ readonly status_read: LocaleMessage;
215
+ readonly status_error: LocaleMessage;
216
+ readonly retry: LocaleMessage;
217
+ readonly loadingOlder: LocaleMessage;
218
+ readonly suggestionsLabel: LocaleMessage;
219
+ /** Composer clear button. */
220
+ readonly clear: LocaleMessage;
221
+ /** `Conversation.Dictation` button. */
222
+ readonly dictate?: LocaleMessage;
223
+ /** `Conversation.Dictation` without speech recognition in the browser. */
224
+ readonly dictationUnsupported?: LocaleMessage;
225
+ readonly edit?: LocaleMessage;
226
+ readonly regenerate?: LocaleMessage;
227
+ readonly helpful?: LocaleMessage;
228
+ readonly notHelpful?: LocaleMessage;
229
+ readonly previousResponse?: LocaleMessage;
230
+ readonly nextResponse?: LocaleMessage;
231
+ /** `{index}` of `{count}` responses. */
232
+ readonly responseIndex?: LocaleMessage;
233
+ readonly reasoning?: LocaleMessage;
234
+ /** Tool part heading: `{name}`, `{status}`. */
235
+ readonly tool?: LocaleMessage;
236
+ readonly toolRunning?: LocaleMessage;
237
+ readonly toolDone?: LocaleMessage;
238
+ readonly toolError?: LocaleMessage;
239
+ /** Pending response (screen readers). */
240
+ readonly responding?: LocaleMessage;
241
+ }
242
+ export type {} from '@salmonui/core/locale';
243
+ declare module '@salmonui/core/locale' {
244
+ interface LocaleCatalog {
245
+ readonly conversation?: Partial<ConversationLocaleText> | undefined;
246
+ }
247
+ }
248
+ export interface ConversationItemRenderContext {
249
+ readonly message: ConversationMessage;
250
+ readonly index: number;
251
+ /** The default item content; wrap or decorate it. */
252
+ readonly defaultItem: ReactNode;
253
+ }
254
+ export interface ConversationApi {
255
+ /** Scrolls to the latest message. */
256
+ scrollToBottom(options?: {
257
+ readonly behavior?: ScrollBehavior;
258
+ }): void;
259
+ /** Scrolls a message into view (mounted or virtualized) and returns whether it exists. */
260
+ scrollToMessage(id: string, options?: {
261
+ readonly focus?: boolean;
262
+ }): boolean;
263
+ /** Focuses the composer input. */
264
+ focus(): void;
265
+ /** Sends `text` as the current user (runs `onBeforeSend` and the adapter). */
266
+ send(text: string): void;
267
+ /** Aborts a pending adapter response. */
268
+ stop(): void;
269
+ /** Assistant variant: runs the adapter again for response `id` and keeps the previous text as an alternative. */
270
+ regenerate(id: string): void;
271
+ /** The root element. */
272
+ readonly element: HTMLDivElement | null;
273
+ }
274
+ export type ConversationPart = 'root' | 'scroller' | 'feed' | 'item' | 'composer' | 'typing';
275
+ /** Context of `renderContent`. */
276
+ export interface ConversationContentContext {
277
+ readonly message: ConversationMessage;
278
+ /** The text is still streaming (called once per animation frame). */
279
+ readonly streaming: boolean;
280
+ }
281
+ export interface ConversationProps {
282
+ /** `'chat'` (people, default) or `'assistant'` (prompts and responses). */
283
+ readonly variant?: 'chat' | 'assistant';
284
+ readonly messages?: readonly ConversationMessage[];
285
+ readonly defaultMessages?: readonly ConversationMessage[];
286
+ readonly onMessagesChange?: (messages: readonly ConversationMessage[], event: ConversationChangeEvent) => void;
287
+ /** User id of the person using the UI; their items align to the inline end (default `'user'`). */
288
+ readonly currentUser?: string;
289
+ readonly users?: readonly ConversationUser[];
290
+ /** User ids typing right now. */
291
+ readonly typingUsers?: readonly string[];
292
+ readonly onBeforeSend?: (event: ConversationBeforeSendEvent) => void;
293
+ readonly onSend?: (event: ConversationSendEvent) => void;
294
+ /** Bot replies: runs after each send; streamed text is flushed once per animation frame. */
295
+ readonly adapter?: ConversationAdapter;
296
+ /** Author id of adapter responses (default `'assistant'`). */
297
+ readonly adapterAuthor?: string;
298
+ readonly onError?: (error: unknown) => void;
299
+ /** Stop, `api.stop()`, a new send or regenerate aborted a pending response. */
300
+ readonly onStop?: (event: {
301
+ readonly message: ConversationMessage | undefined;
302
+ }) => void;
303
+ /**
304
+ * Message text renderer, for example the application's Markdown
305
+ * renderer; default plain text with preserved line breaks. Never HTML
306
+ * strings: return React nodes.
307
+ */
308
+ readonly renderContent?: (text: string, context: ConversationContentContext) => ReactNode;
309
+ /** Assistant: the pending response before the first chunk (default skeleton lines). */
310
+ readonly renderPending?: (context: {
311
+ readonly message: ConversationMessage;
312
+ }) => ReactNode;
313
+ /** Assistant: a reasoning part (default a collapsed disclosure). */
314
+ readonly renderReasoning?: (context: {
315
+ readonly text: string;
316
+ readonly message: ConversationMessage;
317
+ readonly streaming: boolean;
318
+ }) => ReactNode;
319
+ /** Replaces the chip of a sent attachment; `tabIndex` keeps the item's roving tab stop on interactive content. */
320
+ readonly renderAttachment?: (context: {
321
+ readonly attachment: ConversationAttachment;
322
+ readonly message: ConversationMessage;
323
+ readonly tabIndex: 0 | -1;
324
+ }) => ReactNode;
325
+ /** Assistant: tool part renderers by tool name; others use the default summary. */
326
+ readonly renderTool?: Readonly<Record<string, (context: {
327
+ readonly part: ConversationToolPart;
328
+ readonly message: ConversationMessage;
329
+ }) => ReactNode>>;
330
+ /** Assistant: the default reasoning disclosure opened or closed. */
331
+ readonly onReasoningClick?: (event: {
332
+ readonly message: ConversationMessage;
333
+ readonly open: boolean;
334
+ }) => void;
335
+ /** Retry of a message with `status: 'error'`. */
336
+ readonly onRetry?: (event: {
337
+ readonly message: ConversationMessage;
338
+ }) => void;
339
+ /** Composer typing start and stop, at most one of each per burst. */
340
+ readonly onTypingChange?: (event: ConversationTypingEvent) => void;
341
+ /** Idle time in ms after which typing stops (default 3000). */
342
+ readonly typingTimeout?: number;
343
+ /** Show timestamps (default true). */
344
+ readonly timestamps?: boolean;
345
+ /** `Intl.DateTimeFormatOptions` or a formatter (default hour and minute). */
346
+ readonly formatTimestamp?: Intl.DateTimeFormatOptions | ((date: Date, context: {
347
+ readonly locale: string;
348
+ readonly timeZone: string | undefined;
349
+ }) => string);
350
+ /** BCP 47 locale of timestamps (default `'en-US'`). */
351
+ readonly locale?: string;
352
+ /** IANA time zone; without it, times render in UTC on the server and switch to the host zone after hydration. */
353
+ readonly timeZone?: string;
354
+ /** Date separators between days (default false). */
355
+ readonly dateSeparators?: boolean;
356
+ readonly renderDateSeparator?: (context: {
357
+ readonly date: Date;
358
+ readonly label: string;
359
+ }) => ReactNode;
360
+ /** `'bubbles'` (default: own messages at the inline end) or `'compact'` (all at the start). */
361
+ readonly layout?: 'bubbles' | 'compact';
362
+ readonly renderEmpty?: () => ReactNode;
363
+ readonly renderItem?: (context: ConversationItemRenderContext) => ReactNode;
364
+ readonly renderAvatar?: (context: {
365
+ readonly user: ConversationUser | undefined;
366
+ readonly id: string;
367
+ }) => ReactNode;
368
+ readonly renderTyping?: (context: {
369
+ readonly users: readonly ConversationUser[];
370
+ }) => ReactNode;
371
+ /**
372
+ * Actions of every item (chat default copy, reply, pin, delete); `false`
373
+ * hides them. Assistant default: copy, regenerate, feedback on responses;
374
+ * edit, copy on prompts (an object sets each).
375
+ */
376
+ readonly itemActions?: readonly ConversationActionItem[] | {
377
+ readonly prompt?: readonly ConversationActionItem[];
378
+ readonly response?: readonly ConversationActionItem[];
379
+ } | false;
380
+ readonly onItemActionClick?: (event: ConversationItemActionEvent) => void;
381
+ readonly onAttachmentClick?: (event: ConversationAttachmentEvent) => void;
382
+ /** Older history exists (load on demand). */
383
+ readonly hasOlder?: boolean;
384
+ /** Loads older messages; the app prepends them to `messages`. */
385
+ readonly onLoadOlder?: () => Promise<unknown> | void;
386
+ /** `'whenAtBottom'` (default), `'always'` or `'never'`. */
387
+ readonly autoScroll?: 'whenAtBottom' | 'always' | 'never';
388
+ /** Render the default jump-to-latest button (default true). */
389
+ readonly jumpButton?: boolean;
390
+ /** Estimated item height in px before measurement (default 64). */
391
+ readonly estimatedItemHeight?: number;
392
+ /** Items rendered on the server and before measurement (default 30). */
393
+ readonly initialItemCount?: number;
394
+ readonly localeText?: Partial<ConversationLocaleText>;
395
+ readonly className?: string;
396
+ readonly style?: CSSProperties;
397
+ readonly classNames?: Partial<Record<ConversationPart, string>>;
398
+ readonly styles?: Partial<Record<ConversationPart, CSSProperties>>;
399
+ /** Parts: `Conversation.Header`, `.Suggestions`, `.Composer`, `.Footer`, `.JumpButton`. */
400
+ readonly children?: ReactNode;
401
+ readonly ref?: Ref<ConversationApi>;
402
+ }
403
+ export interface ConversationHeaderProps {
404
+ readonly title?: ReactNode;
405
+ readonly icon?: ReactNode;
406
+ /** Toolbar items (buttons); arrow keys move between them (APG Toolbar). */
407
+ readonly children?: ReactNode;
408
+ /** Accessible name of the toolbar (default the title text). */
409
+ readonly toolbarLabel?: string;
410
+ readonly className?: string;
411
+ readonly style?: CSSProperties;
412
+ }
413
+ export interface ConversationComposerProps {
414
+ readonly placeholder?: string;
415
+ /** Controlled draft. */
416
+ readonly value?: string;
417
+ readonly defaultValue?: string;
418
+ readonly onValueChange?: (value: string) => void;
419
+ /** Shows a clear button while there is a draft. */
420
+ readonly clearable?: boolean;
421
+ readonly disabled?: boolean;
422
+ /** Visible rows of the textarea (default 1; it grows with content). */
423
+ readonly rows?: number;
424
+ readonly mentions?: readonly ConversationMentionConfig[];
425
+ readonly onBeforeMentionSelect?: (event: ConversationBeforeMentionSelectEvent) => void;
426
+ readonly onMentionSelect?: (event: ConversationMentionSelectEvent) => void;
427
+ /** Enables attachments (`true` for defaults). */
428
+ readonly attachments?: boolean | ConversationAttachmentOptions;
429
+ readonly onBeforeAttach?: (event: ConversationBeforeAttachEvent) => void;
430
+ readonly onAttach?: (event: ConversationAttachEvent) => void;
431
+ readonly onAttachmentRemove?: (event: ConversationAttachmentEvent) => void;
432
+ readonly onAttachmentError?: (error: ConversationAttachmentError) => void;
433
+ /** Extra controls next to the send button. */
434
+ readonly toolbar?: ReactNode;
435
+ readonly className?: string;
436
+ readonly style?: CSSProperties;
437
+ }
438
+ export interface ConversationSuggestionsProps {
439
+ readonly items: readonly string[];
440
+ readonly heading?: ReactNode;
441
+ readonly renderItem?: (context: {
442
+ readonly item: string;
443
+ readonly index: number;
444
+ }) => ReactNode;
445
+ readonly className?: string;
446
+ readonly style?: CSSProperties;
447
+ }
448
+ export interface ConversationItemProps {
449
+ readonly message: ConversationMessage;
450
+ /** Replaces the message text in the bubble. */
451
+ readonly children?: ReactNode;
452
+ readonly className?: string;
453
+ readonly style?: CSSProperties;
454
+ }
455
+ export interface ConversationItemActionsProps {
456
+ readonly message: ConversationMessage;
457
+ readonly items?: readonly ConversationActionItem[];
458
+ readonly className?: string;
459
+ }
460
+ export interface ConversationJumpButtonProps {
461
+ readonly children?: ReactNode;
462
+ readonly className?: string;
463
+ readonly style?: CSSProperties;
464
+ }
465
+ /** `Conversation.Dictation`: a microphone button over the Inputs `useSpeechRecognition`. */
466
+ export interface ConversationDictationProps {
467
+ /** BCP 47 recognition language (default the document language). */
468
+ readonly lang?: string;
469
+ /** Replaces the browser recognizer (the Inputs `SpeechRecognizer` contract). */
470
+ readonly recognizer?: () => SpeechRecognizer;
471
+ readonly className?: string;
472
+ readonly style?: CSSProperties;
473
+ }
474
+ export interface ConversationFooterProps {
475
+ readonly children?: ReactNode;
476
+ readonly className?: string;
477
+ readonly style?: CSSProperties;
478
+ }
479
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/conversation/types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAExE,oCAAoC;AACpC,MAAM,MAAM,yBAAyB,GAAG,SAAS,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC;AAE5F,+DAA+D;AAC/D,MAAM,WAAW,sBAAsB;IACrC,uEAAuE;IACvE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,qBAAqB;IACrB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB;IACjB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,yEAAyE;IACzE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,6DAA6D;IAC7D,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC;CACtB;AAED,2DAA2D;AAC3D,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,mBAAmB;IAClC,iDAAiD;IACjD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,6BA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AC,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,aAAa,CAAC;CAChC"}
@@ -0,0 +1,5 @@
1
+ // Public types of `@salmonui/chat/conversation`: the chat variant and the
2
+ // assistant variant. The adapter contract is provider-agnostic: no provider SDK
3
+ // types, and model output is text, parts and `ReactNode`, never HTML.
4
+ export {};
5
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/conversation/types.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,gFAAgF;AAChF,sEAAsE"}