@aidapt/caity-chat 3.0.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 (62) hide show
  1. package/README.md +73 -0
  2. package/dist/lib/_baseUniq-BVCT-t6P.js +477 -0
  3. package/dist/lib/arc-Kj6ZmwPS.js +83 -0
  4. package/dist/lib/architectureDiagram-Q4EWVU46-DA4kYaz_.js +4690 -0
  5. package/dist/lib/blockDiagram-DXYQGD6D-BWT5yya1.js +2295 -0
  6. package/dist/lib/c4Diagram-AHTNJAMY-BjY6DW3U.js +1577 -0
  7. package/dist/lib/caity-chat.tgz +0 -0
  8. package/dist/lib/channel-BjraetTo.js +5 -0
  9. package/dist/lib/chunk-4BX2VUAB-iSPZGgxQ.js +8 -0
  10. package/dist/lib/chunk-4TB4RGXK-DvnUcLoe.js +1465 -0
  11. package/dist/lib/chunk-55IACEB6-Mw25YX9j.js +8 -0
  12. package/dist/lib/chunk-EDXVE4YY-Dtbxz7df.js +19 -0
  13. package/dist/lib/chunk-FMBD7UC4-OCIy3top.js +19 -0
  14. package/dist/lib/chunk-OYMX7WX6-DFW9El2C.js +1383 -0
  15. package/dist/lib/chunk-QZHKN3VN-BYFTfk7k.js +15 -0
  16. package/dist/lib/chunk-YZCP3GAM-Cs-HTcyJ.js +68 -0
  17. package/dist/lib/classDiagram-6PBFFD2Q-CrDUlIYr.js +16 -0
  18. package/dist/lib/classDiagram-v2-HSJHXN6E-CrDUlIYr.js +16 -0
  19. package/dist/lib/clone-C0qEGPCz.js +8 -0
  20. package/dist/lib/cose-bilkent-S5V4N54A-H1-YbKvI.js +2609 -0
  21. package/dist/lib/cytoscape.esm-D_3MZVO6.js +18707 -0
  22. package/dist/lib/dagre-KV5264BT-DhEnTJ4D.js +443 -0
  23. package/dist/lib/defaultLocale-BgPVtth8.js +171 -0
  24. package/dist/lib/diagram-5BDNPKRD-CK6wgKxI.js +123 -0
  25. package/dist/lib/diagram-G4DWMVQ6-IhA_MJ0t.js +528 -0
  26. package/dist/lib/diagram-MMDJMWI5-DDuA1rYY.js +217 -0
  27. package/dist/lib/diagram-TYMM5635-_VI1en0S.js +142 -0
  28. package/dist/lib/erDiagram-SMLLAGMA-B1REwW7y.js +899 -0
  29. package/dist/lib/flowDiagram-DWJPFMVM-rWzOGDlg.js +1628 -0
  30. package/dist/lib/ganttDiagram-T4ZO3ILL-UhSvbAmM.js +2701 -0
  31. package/dist/lib/gitGraphDiagram-UUTBAWPF-DrsSMMoJ.js +815 -0
  32. package/dist/lib/graph-DMr8NrNW.js +738 -0
  33. package/dist/lib/index.d.ts +665 -0
  34. package/dist/lib/index.js +52 -0
  35. package/dist/lib/infoDiagram-42DDH7IO-CPF3XCNj.js +24 -0
  36. package/dist/lib/init-DjUOC4st.js +16 -0
  37. package/dist/lib/ishikawaDiagram-UXIWVN3A-B4Nt1TdW.js +621 -0
  38. package/dist/lib/journeyDiagram-VCZTEJTY-DW5yRsOM.js +834 -0
  39. package/dist/lib/kanban-definition-6JOO6SKY-5DmJRubo.js +724 -0
  40. package/dist/lib/layout-B00IQLgh.js +1441 -0
  41. package/dist/lib/linear-LLab47WO.js +259 -0
  42. package/dist/lib/main-C9dvh9CT.js +88771 -0
  43. package/dist/lib/mermaid.core-BrBkhL9h.js +15967 -0
  44. package/dist/lib/min-CJFyJhXg.js +38 -0
  45. package/dist/lib/mindmap-definition-QFDTVHPH-doqZCFNi.js +833 -0
  46. package/dist/lib/ordinal-B6-f3MAq.js +61 -0
  47. package/dist/lib/pieDiagram-DEJITSTG-DKi5GKup.js +163 -0
  48. package/dist/lib/quadrantDiagram-34T5L4WZ-COYWmEhy.js +1022 -0
  49. package/dist/lib/requirementDiagram-MS252O5E-D3odK6YH.js +882 -0
  50. package/dist/lib/sankeyDiagram-XADWPNL6-D36eaMCx.js +810 -0
  51. package/dist/lib/sequenceDiagram-FGHM5R23-NpESTwMk.js +2883 -0
  52. package/dist/lib/standalone.js +4 -0
  53. package/dist/lib/stateDiagram-FHFEXIEX-kXZ_Bn-a.js +263 -0
  54. package/dist/lib/stateDiagram-v2-QKLJ7IA2-B5xMdEuE.js +16 -0
  55. package/dist/lib/timeline-definition-GMOUNBTQ-DZDdcJwy.js +1055 -0
  56. package/dist/lib/vennDiagram-DHZGUBPP-Clhb6EGF.js +1557 -0
  57. package/dist/lib/wardley-RL74JXVD-CwSnyVu7.js +18396 -0
  58. package/dist/lib/wardleyDiagram-NUSXRM2D-DnXL4F04.js +594 -0
  59. package/dist/lib/xychartDiagram-5P7HB3ND-CweIkrg3.js +1342 -0
  60. package/package.json +95 -0
  61. package/src/types/caity-chat.d.ts +213 -0
  62. package/src/types/template-slots.d.ts +167 -0
@@ -0,0 +1,665 @@
1
+ import { JSXElementConstructor } from 'react';
2
+ import { ReactElement } from 'react';
3
+ import { ReactNode } from 'react';
4
+ import { TemplateSlotDataMap } from '../types/template-slots';
5
+
6
+ export declare type AssetType = {
7
+ [key: string]: FileMetadata;
8
+ };
9
+
10
+ /** Opzioni per la gestione degli allegati. */
11
+ declare type AttachmentsOptions = {
12
+ /** Errore mostrato quando il file allegato supera la dimensione massima consentita. */
13
+ fileTooLarge?: string;
14
+ /** Errore mostrato quando si tenta di allegare più file del limite consentito. */
15
+ tooManyFiles?: string;
16
+ /** Tooltip del pulsante per allegare file. */
17
+ tooltip?: string;
18
+ /** Tooltip del pulsante per rimuovere un allegato. */
19
+ removeTooltip?: string;
20
+ };
21
+
22
+ declare type AwsConfig = {
23
+ /** ID voce AWS Polly (es. "Bianca"). */
24
+ voiceId?: string;
25
+ /** Codice lingua AWS (es. "it-IT"). */
26
+ languageCode?: string;
27
+ /** Se true, utilizza il motore TTS neurale di AWS Polly. */
28
+ neural?: boolean;
29
+ };
30
+
31
+ declare const CaityChatErrorCode: {
32
+ readonly NETWORK_ERROR: 0;
33
+ readonly UNAUTHORIZED: 401;
34
+ readonly FORBIDDEN: 403;
35
+ readonly NOT_FOUND: 404;
36
+ readonly EXPIRED_SESSION: 409;
37
+ readonly RATE_LIMIT: 429;
38
+ readonly GUARDRAILS: 600;
39
+ readonly SERIALIZABLE_ERROR: 400;
40
+ readonly UPLOAD_ERROR: 4001;
41
+ };
42
+
43
+ declare type CaityChatErrorCodeType = (typeof CaityChatErrorCode)[keyof typeof CaityChatErrorCode];
44
+
45
+ export declare const CaityChatModuleEvents: {
46
+ readonly ON_MESSAGE_DEBUG?: string | undefined;
47
+ readonly ON_MESSAGE: "caity-on-message";
48
+ readonly ON_CONNECT: "caity-on-connect";
49
+ readonly ON_SESSION_CHANGE: "caity-on-session-change";
50
+ readonly ON_FEEDBACK: "caity-on-feedback";
51
+ readonly ON_RECEIVE_SETUP: "caity-on-receive-setup";
52
+ readonly ON_RECEIVE_HISTORY: "caity-on-receive-history";
53
+ readonly ON_CAITY_ERROR: "caity-on-error";
54
+ };
55
+
56
+ export declare type CaityChatModuleEventsType = (typeof CaityChatModuleEvents)[keyof typeof CaityChatModuleEvents];
57
+
58
+ export declare const CaityChatModuleReceiveEvents: {
59
+ readonly CHANGE_SETUP?: string | undefined;
60
+ /** Payload: { sessionId: string, setup?: ChatSetup } */
61
+ readonly CHANGE_SESSION: "caity-change-session";
62
+ readonly ADD_METADATA: "caity-add-metadata";
63
+ readonly CHANGE_INPUT: "caity-change-input";
64
+ readonly SEND_INPUT: "caity-send-input";
65
+ readonly LOCK_CHAT: "caity-lock-chat";
66
+ readonly UNLOCK_CHAT: "caity-unlock-chat";
67
+ };
68
+
69
+ export declare type CaityChatModuleReceiveEventsType = (typeof CaityChatModuleReceiveEvents)[keyof typeof CaityChatModuleReceiveEvents];
70
+
71
+ declare type CaityErrorHandler = (status: CaityChatErrorCodeType, content?: string) => void | Promise<void>;
72
+
73
+ export declare type CaityMimeType = "text/plain" | "text/html" | "text/css" | "text/javascript" | "text/xml" | "text/markdown" | "image/jpeg" | "image/png" | "image/gif" | "image/svg+xml" | "image/webp" | "image/bmp" | "audio/mpeg" | "audio/ogg" | "audio/wav" | "audio/webm" | "audio/aac" | "video/mp4" | "video/webm" | "video/ogg" | "video/mpeg" | "application/json" | "application/xml" | "application/pdf" | "application/zip" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/vnd.ms-powerpoint" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "application/msword" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "font/ttf" | "font/woff" | "font/woff2" | "multipart/form-data" | "multipart/byteranges";
74
+
75
+ declare type ConnectionBasePayload = {
76
+ app: string;
77
+ session: string | null;
78
+ metadata?: object;
79
+ };
80
+
81
+ export declare type ConnectionError = {
82
+ status: number;
83
+ message: string;
84
+ content?: string;
85
+ };
86
+
87
+ /**
88
+ * Abstract connection interface.
89
+ * Implementations can use HTTP, WebSocket, or any other protocol.
90
+ * `sendMessage` returns a ReadableStream because the server streams the response.
91
+ * `sendFeedback` has no response body.
92
+ */
93
+ export declare interface ConnectionService {
94
+ setup(request: SetupRequest, signal?: AbortSignal): Promise<SetupResponse>;
95
+ upload(files: File[], app: string): Promise<FileReference[]>;
96
+ /**
97
+ * Fetches a protected asset by URL, attaching the bearer token when the chat
98
+ * is authenticated. Returns the raw Blob so callers can expose it as an object
99
+ * URL (since <img>/<audio>/<video> elements cannot send Authorization headers).
100
+ */
101
+ fetchAsset(url: string, signal?: AbortSignal): Promise<Blob>;
102
+ sendMessage(request: SendMessageRequest): Promise<ReadableStream<SessionResponse | MessageResponse>>;
103
+ retry(request: RetryRequest): Promise<ReadableStream<SessionResponse | MessageResponse>>;
104
+ sendFeedback(request: SendFeedbackRequest): Promise<void>;
105
+ history(request: HistoryRequest): Promise<HistoryResponse>;
106
+ tts(request: TTSRequest, signal?: AbortSignal, langConfig?: {
107
+ voiceId: string;
108
+ languageCode: string;
109
+ neural: boolean;
110
+ }): Promise<TTSResponse>;
111
+ stt(request: STTRequest, signal?: AbortSignal): Promise<STTResponse>;
112
+ registerErrorHandler(status: CaityChatErrorCodeType, handler: CaityErrorHandler): void;
113
+ registerGlobalErrorHandler(handler: CaityErrorHandler): void;
114
+ }
115
+
116
+ /** Opzioni specifiche per la variante cover. */
117
+ declare type CoverVariantOptions = {
118
+ /** Se true, la chat occupa l'intero contenitore senza margini. */
119
+ coverAll?: boolean;
120
+ /** Se true, rimuove il border-radius dal bordo inferiore della chat. */
121
+ bottomNotRounded?: boolean;
122
+ };
123
+
124
+ /**
125
+ * React bridge for caity-chat template slots.
126
+ *
127
+ * Place it as a direct child of `<caity-chat>` to override a slot with
128
+ * React JSX. The component renders a Light DOM marker element that
129
+ * `collectTemplates` picks up, and registers a global render function that
130
+ * `PortalSlot` (inside the Shadow DOM) calls whenever the slot data changes.
131
+ *
132
+ * A React root is created lazily on first call and reused on subsequent data
133
+ * updates so no React tree is ever unmounted between renders.
134
+ *
135
+ * ```tsx
136
+ * <caity-chat>
137
+ * <CustomTemplate name="caity-user-message">
138
+ * {(message) => message ? (
139
+ * <div className="my-bubble">{message.content}</div>
140
+ * ) : null}
141
+ * </CustomTemplate>
142
+ * </caity-chat>
143
+ * ```
144
+ */
145
+ export declare function CustomTemplate<K extends keyof TemplateSlotDataMap>({ name, className, children, }: CustomTemplateProps<K>): ReactElement< {
146
+ class?: string | undefined;
147
+ 'data-caity-portal': string;
148
+ render: string;
149
+ }, string | JSXElementConstructor<any>>;
150
+
151
+ declare interface CustomTemplateProps<K extends keyof TemplateSlotDataMap> {
152
+ /** Slot name to override (e.g. `'caity-user-message'`). */
153
+ name: K;
154
+ /**
155
+ * Render prop receiving the slot's typed data.
156
+ *
157
+ * ```tsx
158
+ * <CustomTemplate name="caity-user-message">
159
+ * {(message) => message ? <div>{message.content}</div> : null}
160
+ * </CustomTemplate>
161
+ * ```
162
+ */
163
+ className?: string;
164
+ children: RenderFn<TemplateSlotDataMap[K]>;
165
+ }
166
+
167
+ export declare type Feedback = {
168
+ points?: number;
169
+ comment?: string;
170
+ };
171
+
172
+ declare type FeedbackOptions = {
173
+ /** Se true, il feedback usa una valutazione numerica al posto dei pollici su/giù. */
174
+ numericalFeedback?: boolean;
175
+ /** Titolo del dialog di feedback. */
176
+ dialogTitle?: string;
177
+ /** Etichetta del pulsante di invio nel dialog di feedback. */
178
+ dialogSendButton?: string;
179
+ /** Etichetta del pulsante di cancellazione nel dialog di feedback. */
180
+ dialogCancelButton?: string;
181
+ /** Descrizione del messaggio feedback. */
182
+ dialogDescription?: string;
183
+ /** Placeholder del messaggio feedback. */
184
+ dialogPlaceholder?: string;
185
+ /** Tooltip del pulsante pollice su. */
186
+ feedbackUpTooltip?: string;
187
+ /** Tooltip del pulsante pollice giù. */
188
+ feedbackDownTooltip?: string;
189
+ /** Tooltip del campo testo libero nel dialog di feedback. */
190
+ feedbackMessageTooltip?: string;
191
+ };
192
+
193
+ export declare type FeedbackRequest = {
194
+ id: string;
195
+ feedback: Feedback | undefined;
196
+ };
197
+
198
+ export declare type FileMetadata = {
199
+ key: string;
200
+ label?: string;
201
+ type: CaityMimeType;
202
+ url: string;
203
+ /** Tree-agent asset coordinates, used to build the asset download URL. */
204
+ node_id?: number | null;
205
+ chunk_id?: number | null;
206
+ tree_agent_id?: string | null;
207
+ /**
208
+ * Conversation-file id. Present (instead of the tree-agent coordinates) for
209
+ * files generated or uploaded during a conversation. Resolved to the
210
+ * `conversation-files/{file_id}` download route.
211
+ */
212
+ file_id?: string | null;
213
+ };
214
+
215
+ declare type FileReference = {
216
+ createdAt?: string;
217
+ deletedAt?: string | null;
218
+ fileName: string;
219
+ id: string;
220
+ message?: string | null;
221
+ messageId?: string | null;
222
+ sessionId?: string | null;
223
+ setupId?: string;
224
+ subscription?: string | null;
225
+ updatedAt?: string;
226
+ uploadedFileName?: string;
227
+ };
228
+
229
+ /** Opzioni specifiche per la variante floating. */
230
+ declare type FloatingVariantOptions = {
231
+ /** Se true, la chat si apre automaticamente al caricamento della pagina. */
232
+ open?: boolean;
233
+ /** Distanza del floatinButton dal bordo destro della finestra. */
234
+ 'floating-right'?: string;
235
+ /** Distanza del floatinButton dal bordo inferiore della finestra. */
236
+ 'floating-bottom'?: string;
237
+ };
238
+
239
+ declare type FormFieldSchema = {
240
+ type: 'string' | 'number' | 'integer' | 'boolean';
241
+ title?: string;
242
+ description?: string;
243
+ /** Renders a <select> when present. */
244
+ enum?: string[];
245
+ /** 'date' → single date picker. 'date-range' → from/to date pair. */
246
+ format?: 'date' | 'date-range';
247
+ /** String constraints */
248
+ minLength?: number;
249
+ maxLength?: number;
250
+ /** Regex the value must satisfy (string fields). */
251
+ pattern?: string;
252
+ /** Number/integer constraints */
253
+ minimum?: number;
254
+ maximum?: number;
255
+ /** Maps to HTML step attribute (non-standard JSON Schema extension). */
256
+ step?: number;
257
+ /** Per-keyword error messages shown on validation failure. */
258
+ errorMessage?: {
259
+ required?: string;
260
+ pattern?: string;
261
+ minLength?: string;
262
+ maxLength?: string;
263
+ minimum?: string;
264
+ maximum?: string;
265
+ };
266
+ };
267
+
268
+ declare type FormSchema = {
269
+ type: 'object';
270
+ title?: string;
271
+ description?: string;
272
+ properties: Record<string, FormFieldSchema>;
273
+ required?: string[];
274
+ };
275
+
276
+ export declare type HistoryRequest = ConnectionBasePayload;
277
+
278
+ export declare type HistoryResponse = {
279
+ messages: Message[];
280
+ };
281
+
282
+ export declare type Message = {
283
+ id?: string;
284
+ streamId: string;
285
+ sender: MessageSenderTypes;
286
+ content: string;
287
+ createdAt?: number;
288
+ lastUpdate?: number;
289
+ error?: string;
290
+ metadata?: MetaData;
291
+ event?: string;
292
+ reasoning?: Reasoning[];
293
+ files?: {
294
+ fileName: string;
295
+ id: string;
296
+ }[];
297
+ };
298
+
299
+ export declare type MessageResponse = {
300
+ id: string;
301
+ sender: MessageSenderTypes;
302
+ streamEnded?: boolean;
303
+ chunk?: string;
304
+ message?: string;
305
+ event?: ReceivedEventData;
306
+ metadata?: MetaData;
307
+ referTo: string;
308
+ };
309
+
310
+ /** Testi localizzabili visualizzati nell'interfaccia della chat. */
311
+ export declare type Messages = {
312
+ /** Messaggio iniziale mostrato all'apertura della chat. */
313
+ greeting?: string;
314
+ /** Avviso (markdown, max 240 caratteri) mostrato centrato come sfondo della chat finché non viene inviato il primo messaggio. Se vuoto, non viene mostrato. */
315
+ backgroundNotice?: string;
316
+ /** Testo disclaimer mostrato in fondo alla lista messaggi. */
317
+ disclaimer?: string;
318
+ /** Placeholder del campo di input quando è vuoto. */
319
+ placeholder?: string;
320
+ /** Titolo visualizzato nell'header della chat. */
321
+ chatTitle?: string;
322
+ /** Etichetta della voce "riavvia" nel menu dropdown dell'header. */
323
+ dropDownHistory?: string;
324
+ /** Etichetta della voce "informazioni" nel menu dropdown dell'header. */
325
+ dropDownAbout?: string;
326
+ /** Testo mostrato nel campo di input mentre il server sta elaborando la risposta. */
327
+ sendingPlaceholder?: string;
328
+ /** Etichetta del separatore che indica il limite della context window tra i messaggi. */
329
+ contextWindowTitle?: string;
330
+ /** Domande predefinite mostrate come chip di risposta rapida sopra il campo di input. */
331
+ staticQuestions?: string[];
332
+ /** Prefisso del contatore dei caratteri rimanenti (es. "Caratteri rimasti: 200/1000"). */
333
+ availableChars?: string;
334
+ /** Errore mostrato quando il testo incollato supera il limite di caratteri. */
335
+ unableToPasteCharLimit?: string;
336
+ /** Messaggio di errore generico per errori imprevisti del server. */
337
+ defaultError?: string;
338
+ /** Messaggio di errore mostrato quando il server non è raggiungibile. */
339
+ connectionError?: string;
340
+ /** Messaggio di errore mostrato quando l'autenticazione fallisce (401/403). */
341
+ authorizationError?: string;
342
+ /** Messaggio di errore mostrato quando il server risponde con 404 session_not_found (la sessione non esiste più). */
343
+ sessionNotFoundError?: string;
344
+ /** Messaggio di errore mostrato quando la sessione ha oltrepassato l'expiration time. */
345
+ expiredSessionError?: string;
346
+ /** Messaggio di errore mostrato quando il setup risponde con 403 app_not_usable (privacy policy non configurata o in pending). */
347
+ appNotUsableError?: string;
348
+ /** Messaggio di errore mostrato quando il server risponde con 400 app_not_found (codice app non trovato). */
349
+ appNotFoundError?: string;
350
+ /** Messaggio di avviso mostrato quando il server risponde con 429 (limite di interazioni per minuto raggiunto). */
351
+ rateLimitError?: string;
352
+ /** Messaggio di errore mostrato quando il caricamento di un allegato fallisce (es. formato non supportato, file troppo grande). */
353
+ uploadError?: string;
354
+ /** Messaggio di errore mostrato quando il flow esegue il nodo guardrail e viene inviato il codice di errore 409. */
355
+ guardrailError?: string;
356
+ /** Messaggio sostitutivo del messaggio inviato dall'utente quando il flow esegue il nodo guardrail e viene inviato il codice di errore 600. */
357
+ guardrailPlaceholder?: string;
358
+ /** Tooltip del pulsante di invio messaggio. */
359
+ sendTooltip?: string;
360
+ /** Tooltip del pulsante di copia messaggio. */
361
+ copyTooltip?: string;
362
+ /** Tooltip del pulsante per modificare un messaggio. */
363
+ retryTooltip?: string;
364
+ /** Tooltip del pulsante per annullare la modifica del messaggio e ripristinare il precedente. */
365
+ retryCancelTooltip?: string;
366
+ /** Tooltip del separatore della context window, spiega all'utente il significato del marcatore. */
367
+ contextWindowTooltip?: string;
368
+ /** Tooltip del pulsante flottante quando la chat è chiusa. */
369
+ collapsedTooltip?: string;
370
+ /** Tooltip del pulsante per chiudere/minimizzare la chat. */
371
+ uncollapsedTooltip?: string;
372
+ /** Etichetta del pulsante per mostrare il ragionamento del modello. */
373
+ showReasoning?: string;
374
+ /** Etichetta del pulsante per nascondere il ragionamento del modello. */
375
+ hideReasoning?: string;
376
+ /** Tooltip del pulsante per scorrere fino all'ultimo messaggio. */
377
+ scrollToBottomTooltip?: string;
378
+ /** Avviso mostrato all'utente quando la risposta in streaming è più lenta del solito. */
379
+ streamSlowWarning?: string;
380
+ /** Messaggio di errore mostrato quando lo streaming viene interrotto per timeout. */
381
+ streamAbortError?: string;
382
+ /** Messaggio mostrato mentre si attende la conferma di interruzione dello streaming. */
383
+ streamAbortWait?: string;
384
+ /** Etichetta del pulsante per interrompere manualmente lo streaming. */
385
+ streamAbortStop?: string;
386
+ /** Avviso mostrato all'utente quando il server impiega troppo a rispondere al setup iniziale. */
387
+ setupTimeoutWarning?: string;
388
+ /** Suffisso del chip delle fonti */
389
+ sourcesTooltip?: string;
390
+ /** Etichetta del pulsante di invio nei form inline della chat. */
391
+ formSubmitButton?: string;
392
+ /** Messaggio di errore mostrato quando un campo obbligatorio del form inline non è compilato. */
393
+ formRequiredError?: string;
394
+ /** Messaggio di errore mostrato quando il valore di un campo del form inline non rispetta il pattern richiesto. */
395
+ formPatternError?: string;
396
+ /** Titolo del dialog di modifica degli allegati testuali. */
397
+ textAttachmentDialogTitle?: string;
398
+ /** Etichetta del campo nome file nel dialog di modifica allegato. */
399
+ textAttachmentFileName?: string;
400
+ /** Etichetta del campo contenuto nel dialog di modifica allegato. */
401
+ textAttachmentFileContent?: string;
402
+ /** Etichetta del pulsante Annulla nel dialog di modifica allegato. */
403
+ textAttachmentCancel?: string;
404
+ /** Etichetta del pulsante Rimuovi nel dialog di modifica allegato. */
405
+ textAttachmentRemove?: string;
406
+ /** Etichetta del pulsante che riporta il contenuto dell'allegato nella textarea. */
407
+ textAttachmentToTextarea?: string;
408
+ /** Etichetta del pulsante Salva nel dialog di modifica allegato. */
409
+ textAttachmentSave?: string;
410
+ /** Testo mostrato durante il rendering di un diagramma Mermaid. */
411
+ mermaidRenderingDiagram?: string;
412
+ /** Tooltip del pulsante per passare alla vista codice nel blocco preview. */
413
+ previewShowCode?: string;
414
+ /** Tooltip del pulsante per tornare alla vista preview nel blocco preview. */
415
+ previewShowPreview?: string;
416
+ /** Tooltip del pulsante copia codice nel blocco preview. */
417
+ previewCopyCode?: string;
418
+ /** Tooltip del pulsante per passare alla vista testo grezzo nel messaggio. */
419
+ markdownToggleRaw?: string;
420
+ /** Tooltip del pulsante per passare alla vista anteprima markdown nel messaggio. */
421
+ markdownTogglePreview?: string;
422
+ /** Mappa nome-evento → testo descrittivo mostrato nella chat per gli eventi di risposta. */
423
+ events?: {
424
+ [key: string]: string;
425
+ };
426
+ };
427
+
428
+ export declare type MessageSenderTypes = "user" | "machine" | "error" | "system";
429
+
430
+ export declare type MetaData = {
431
+ systemScope?: number;
432
+ total_price?: number;
433
+ elapsed_time?: number;
434
+ feedback?: Feedback;
435
+ select_options?: string[];
436
+ server_metadata?: ServerMetadata;
437
+ assets?: {
438
+ [key: string]: FileMetadata;
439
+ };
440
+ files?: {
441
+ [key: string]: FileMetadata;
442
+ };
443
+ sources?: Source[];
444
+ error_code?: number;
445
+ error_content?: string;
446
+ is_deleted?: boolean;
447
+ __tempMetadata?: unknown;
448
+ [key: string]: any;
449
+ };
450
+
451
+ /** Opzioni di configurazione del widget. */
452
+ export declare type Options = {
453
+ /** Variante visiva del widget: floating (pulsante flottante) o cover (integrato nella pagina). */
454
+ themeVariant?: 'floating' | 'cover';
455
+ /** Opzioni specifiche per la variante cover. */
456
+ coverVariantOptions?: CoverVariantOptions;
457
+ /** Opzioni specifiche per la variante floating. */
458
+ floatingVariantOptions?: FloatingVariantOptions;
459
+ feedbackOptions?: FeedbackOptions;
460
+ responseEventOptions?: ResponseEventOptions;
461
+ /** Numero massimo di caratteri consentiti nel campo di input. */
462
+ maxCharsNumber?: number;
463
+ /** Numero di caratteri oltre il quale un testo incollato viene convertito automaticamente in allegato. Default: 5000. */
464
+ pasteToAttachmentThreshold?: number;
465
+ /** Opzioni per il servizio vocale (STT e TTS). */
466
+ voiceServiceOptions?: VoiceServiceOptions;
467
+ /** Opzioni per la gestione degli allegati. */
468
+ attachmentsOptions?: AttachmentsOptions;
469
+ };
470
+
471
+ declare type Reasoning = {
472
+ title: string;
473
+ content: string;
474
+ };
475
+
476
+ declare type ReceivedEventData = {
477
+ name: string;
478
+ kind: 'spinner' | 'reasoning';
479
+ content?: string;
480
+ };
481
+
482
+ declare type RenderFn<TData> = (data: TData) => ReactNode;
483
+
484
+ declare type ResponseEventOptions = {
485
+ /** Prefisso testuale mostrato prima del tempo di risposta (es. "Risposto in:"). */
486
+ responseTime?: string;
487
+ };
488
+
489
+ declare type RetryRequest = ConnectionBasePayload & {
490
+ message: Message;
491
+ };
492
+
493
+ export declare type SendFeedbackRequest = ConnectionBasePayload & {
494
+ messageId: string;
495
+ points: number;
496
+ comment?: string;
497
+ };
498
+
499
+ export declare type SendMessageRequest = ConnectionBasePayload & {
500
+ message: Message;
501
+ };
502
+
503
+ declare type ServerMetadata = {
504
+ form_schema?: FormSchema;
505
+ form_response?: Record<string, unknown>;
506
+ };
507
+
508
+ declare type SessionResponse = {
509
+ session: string;
510
+ };
511
+
512
+ export declare type SetupEventMessages = {
513
+ [eventType: string]: string;
514
+ };
515
+
516
+ export declare type SetupRequest = {
517
+ app: string;
518
+ };
519
+
520
+ export declare type SetupResponse = {
521
+ config: SkillConfig;
522
+ aspect: SkillAspect;
523
+ };
524
+
525
+ export declare type SkillAspect = {
526
+ /** Versione dello schema dell'aspect e della chat (es. v1.0.0). */
527
+ version: string;
528
+ /** Lingue disponibili per la traduzione (es. ["it", "en"]). Se vuoto, la lingua è unica. */
529
+ availableLanguages?: string[];
530
+ /** Opzioni di configurazione del widget. */
531
+ options: Options;
532
+ /** Testi localizzabili visualizzati nell'interfaccia della chat. */
533
+ messages: Messages;
534
+ /** CSS personalizzato iniettato nello Shadow DOM del widget. */
535
+ customStyles?: string;
536
+ };
537
+
538
+ declare type SkillConfig = {
539
+ contextHistory?: number;
540
+ maxUploadFileSize?: number;
541
+ maxFilesNumber?: number;
542
+ acceptedFileFormats?: string;
543
+ enabledPrice?: boolean;
544
+ enabledFileUpload?: boolean;
545
+ enableFeedback?: boolean;
546
+ enableMessageTime?: boolean;
547
+ enableResponseEvent?: boolean;
548
+ enableVoiceService?: boolean;
549
+ streamWarningTimeout?: number;
550
+ pasteToAttachmentThreshold?: number;
551
+ };
552
+
553
+ declare type Source = {
554
+ title: string;
555
+ content: string;
556
+ };
557
+
558
+ declare type STTRequest = {
559
+ voiceServiceUrl: string;
560
+ audio: Blob;
561
+ };
562
+
563
+ declare type STTResponse = {
564
+ text: string;
565
+ };
566
+
567
+ export declare type ThemeConfig = {
568
+ variant: ThemeVariant;
569
+ };
570
+
571
+ declare type ThemeVariant = "floating" | "cover";
572
+
573
+ declare type TTSRequest = {
574
+ voiceServiceUrl: string;
575
+ text: string;
576
+ langConfig?: AwsConfig;
577
+ };
578
+
579
+ declare type TTSResponse = {
580
+ url: string;
581
+ };
582
+
583
+ /** Opzioni per il servizio vocale (STT e TTS). */
584
+ declare type VoiceServiceOptions = {
585
+ /** URL dell'endpoint del servizio vocale esterno. */
586
+ url?: string;
587
+ /** Configurazione AWS Polly per lingua. Chiave = codice lingua (es. "it"). */
588
+ awsConfig?: {
589
+ [key: string]: AwsConfig;
590
+ };
591
+ /** Tooltip del pulsante per avviare la registrazione vocale (STT). */
592
+ sttPlayTooltip?: string;
593
+ /** Tooltip del pulsante per fermare la registrazione vocale (STT). */
594
+ sttStopTooltip?: string;
595
+ /** Tooltip mostrato mentre il riconoscimento vocale è in elaborazione. */
596
+ sttLoadingTooltip?: string;
597
+ /** Messaggio di errore mostrato quando il riconoscimento vocale fallisce. */
598
+ sttError?: string;
599
+ /** Tooltip del pulsante per riprodurre il messaggio con sintesi vocale (TTS). */
600
+ ttsPlayTooltip?: string;
601
+ /** Tooltip del pulsante per fermare la riproduzione TTS. */
602
+ ttsStopTooltip?: string;
603
+ /** Tooltip mostrato mentre il TTS sta caricando l'audio. */
604
+ ttsLoadingTooltip?: string;
605
+ };
606
+
607
+ export { }
608
+
609
+
610
+ declare module 'react' {
611
+ namespace JSX {
612
+ interface IntrinsicElements {
613
+ 'caity-chat': CaityHostProps;
614
+ 'caity-attachment-chip': CaitySlotProps;
615
+ 'caity-attachment-list': CaitySlotProps;
616
+ 'caity-background-notice': CaitySlotProps;
617
+ 'caity-bot-avatar-icon': CaitySlotProps;
618
+ 'caity-chat-container': CaitySlotProps;
619
+ 'caity-chat-floating-button': CaitySlotProps;
620
+ 'caity-chat-window': CaitySlotProps;
621
+ 'caity-context-message': CaitySlotProps;
622
+ 'caity-error-message': CaitySlotProps;
623
+ 'caity-footer': CaitySlotProps;
624
+ 'caity-greeting-message': CaitySlotProps;
625
+ 'caity-header': CaitySlotProps;
626
+ 'caity-header-dropdown': CaitySlotProps;
627
+ 'caity-header-dropdown-item': CaitySlotProps;
628
+ 'caity-header-item': CaitySlotProps;
629
+ 'caity-header-logo': CaitySlotProps;
630
+ 'caity-input': CaitySlotProps;
631
+ 'caity-input-chars-alert': CaitySlotProps;
632
+ 'caity-input-textarea': CaitySlotProps;
633
+ 'caity-machine-message': CaitySlotProps;
634
+ 'caity-machine-message-attachment-chip': CaitySlotProps;
635
+ 'caity-messages': CaitySlotProps;
636
+ 'caity-msg-action-item': CaitySlotProps;
637
+ 'caity-msg-actions': CaitySlotProps;
638
+ 'caity-msg-collapse': CaitySlotProps;
639
+ 'caity-msg-copy': CaitySlotProps;
640
+ 'caity-msg-debug': CaitySlotProps;
641
+ 'caity-msg-feedback': CaitySlotProps;
642
+ 'caity-msg-retry': CaitySlotProps;
643
+ 'caity-msg-select-option': CaitySlotProps;
644
+ 'caity-msg-select-options': CaitySlotProps;
645
+ 'caity-msg-sources': CaitySlotProps;
646
+ 'caity-msg-time': CaitySlotProps;
647
+ 'caity-msg-toolbox': CaitySlotProps;
648
+ 'caity-msg-tts': CaitySlotProps;
649
+ 'caity-scroll-to-bottom-button': CaitySlotProps;
650
+ 'caity-slow-response-abort-message': CaitySlotProps;
651
+ 'caity-slow-response-warning-message': CaitySlotProps;
652
+ 'caity-static-question-item': CaitySlotProps;
653
+ 'caity-static-questions': CaitySlotProps;
654
+ 'caity-time-divider-message': CaitySlotProps;
655
+ 'caity-toolbox': CaitySlotProps;
656
+ 'caity-toolbox-item': CaitySlotProps;
657
+ 'caity-toolbox-item-attachment': CaitySlotProps;
658
+ 'caity-toolbox-item-send': CaitySlotProps;
659
+ 'caity-toolbox-item-stt': CaitySlotProps;
660
+ 'caity-user-message': CaitySlotProps;
661
+ 'caity-user-message-attachment-container': CaitySlotProps;
662
+ 'caity-user-message-content': CaitySlotProps;
663
+ }
664
+ }
665
+ }