@elia-assistant/chatui 1.0.9 → 1.0.10
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.
- package/dist/chat-store.js +14 -0
- package/dist/chatui.css +1 -1
- package/dist/chatui.iife.css +1 -1
- package/dist/chatui.iife.js +26 -26
- package/dist/chunks/i18n-23dPrR-0.js +2 -0
- package/dist/chunks/{i18n-Bk--20yp.js → i18n-B0xhVAye.js} +3 -3
- package/dist/chunks/{settingsStore-Br8PCCHq.js → settingsStore-CpRkCJCy.js} +2 -2
- package/dist/chunks/{translation-CBfL69md.js → translation-CsXAAc6O.js} +19 -15
- package/dist/chunks/{translation-Bsz_89rP.js → translation-D0S7F5mA.js} +19 -15
- package/dist/components/MessageBubble.d.ts +3 -1
- package/dist/hooks/useChat.d.ts +1 -0
- package/dist/index.js +1754 -1687
- package/dist/lib/n8nClient.d.ts +12 -1
- package/dist/store/chatStore.d.ts +1 -0
- package/dist/store.js +1 -1
- package/dist/types/index.d.ts +5 -0
- package/package.json +1 -1
- package/dist/chunks/i18n-BOl-CfVk.js +0 -2
package/dist/lib/n8nClient.d.ts
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import type { ChatConfig } from '../types/index.ts';
|
|
2
2
|
export declare class N8nApiError extends Error {
|
|
3
3
|
readonly status?: number;
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* True when the underlying transport or status code indicates the request can be safely
|
|
6
|
+
* retried (network failure, 408, 429, 502/503/504). 4xx responses (other than 408/429) and
|
|
7
|
+
* any error that occurred after streaming chunks have been written are non-retryable.
|
|
8
|
+
*/
|
|
9
|
+
readonly retryable: boolean;
|
|
10
|
+
constructor(message: string, status?: number, retryable?: boolean);
|
|
5
11
|
}
|
|
6
12
|
/**
|
|
7
13
|
* Send a message to the n8n webhook.
|
|
@@ -9,9 +15,14 @@ export declare class N8nApiError extends Error {
|
|
|
9
15
|
* Non-streaming: expects { output: string } response.
|
|
10
16
|
* Streaming: SSE; each event contains data: { text: "chunk" } or data: { output: "full" }.
|
|
11
17
|
*
|
|
18
|
+
* Automatically retries transient transport failures (network errors, 408, 429, 502/503/504)
|
|
19
|
+
* with short backoff. Other 4xx and any error that occurs *after* streaming has begun are
|
|
20
|
+
* surfaced immediately — duplicating partially-delivered content would be worse than failing.
|
|
21
|
+
*
|
|
12
22
|
* @param config Chat configuration
|
|
13
23
|
* @param sessionId Current session ID (maps to chatSessionKey)
|
|
14
24
|
* @param text User message text
|
|
25
|
+
* @param language Optional ISO 639-1 code forwarded to n8n
|
|
15
26
|
* @param onChunk Called with each streaming chunk (enables streaming mode)
|
|
16
27
|
* @returns Full bot response text
|
|
17
28
|
*/
|
|
@@ -12,6 +12,7 @@ interface ChatState {
|
|
|
12
12
|
removeLastBotIfEmpty(sessionId: string): void;
|
|
13
13
|
setStreaming(val: boolean): void;
|
|
14
14
|
setAwaitingAgentReply(sessionId: string, val: boolean): void;
|
|
15
|
+
updateMessageStatus(sessionId: string, messageId: string, status: NonNullable<Message['status']>): void;
|
|
15
16
|
deleteSession(id: string): void;
|
|
16
17
|
renameSession(id: string, title: string): void;
|
|
17
18
|
clearMessages(sessionId: string): void;
|
package/dist/store.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "./chunks/settingsStore-
|
|
1
|
+
import { t as e } from "./chunks/settingsStore-CpRkCJCy.js";
|
|
2
2
|
export { e as useSettingsStore };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -119,6 +119,11 @@ export interface Message {
|
|
|
119
119
|
role: 'user' | 'bot';
|
|
120
120
|
content: string;
|
|
121
121
|
ts: number;
|
|
122
|
+
/**
|
|
123
|
+
* Delivery status for user messages. <c>undefined</c> on persisted history (treated as
|
|
124
|
+
* <c>'sent'</c>) and on every bot message — bots don't have a sender-side delivery state.
|
|
125
|
+
*/
|
|
126
|
+
status?: 'sending' | 'sent' | 'failed';
|
|
122
127
|
}
|
|
123
128
|
export interface Session {
|
|
124
129
|
id: string;
|
package/package.json
CHANGED