@kodaris/krubble-app-components 1.0.70 → 1.0.71
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/chatbot.d.ts +72 -26
- package/dist/chatbot.d.ts.map +1 -1
- package/dist/chatbot.js +299 -203
- package/dist/chatbot.js.map +1 -1
- package/dist/krubble-app.bundled.js +298 -203
- package/dist/krubble-app.bundled.js.map +1 -1
- package/dist/krubble-app.bundled.min.js +195 -147
- package/dist/krubble-app.bundled.min.js.map +1 -1
- package/dist/krubble-app.umd.js +298 -203
- package/dist/krubble-app.umd.js.map +1 -1
- package/dist/krubble-app.umd.min.js +226 -178
- package/dist/krubble-app.umd.min.js.map +1 -1
- package/package.json +1 -1
package/dist/chatbot.d.ts
CHANGED
|
@@ -1,27 +1,58 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
2
|
/**
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
3
|
+
* An internal file stored on the server. Mirrors the backend InternalFileViewDto
|
|
4
|
+
* (and its InternalFileCreateUpdateDto base), so files loaded with a conversation
|
|
5
|
+
* pass through unchanged. The chatbot displays images from these by building a
|
|
6
|
+
* view URL from `internalFileID` at render time.
|
|
7
7
|
*/
|
|
8
|
-
export interface
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
name?: string;
|
|
13
|
-
/** MIME type, if known. */
|
|
8
|
+
export interface KRChatbotInternalFile {
|
|
9
|
+
internalFileID: number;
|
|
10
|
+
internalFileUUID?: string;
|
|
11
|
+
niceName?: string;
|
|
14
12
|
mimeType?: string;
|
|
13
|
+
lastModified?: string;
|
|
14
|
+
fileType?: string;
|
|
15
|
+
path?: string;
|
|
16
|
+
created?: string;
|
|
17
|
+
entityID?: number;
|
|
18
|
+
entityType?: string;
|
|
19
|
+
geoCoordinates?: string;
|
|
20
|
+
imageDetectionType?: string;
|
|
21
|
+
name?: string;
|
|
22
|
+
description?: string;
|
|
23
|
+
creator?: string;
|
|
24
|
+
keywords?: string;
|
|
25
|
+
subType?: string;
|
|
26
|
+
alt?: string;
|
|
27
|
+
metadata?: string;
|
|
28
|
+
deleted?: boolean;
|
|
29
|
+
extraText?: string;
|
|
30
|
+
emailID?: number;
|
|
31
|
+
aiPimSource?: string;
|
|
32
|
+
aiPimLastParsed?: string;
|
|
33
|
+
aiPimStatus?: string;
|
|
34
|
+
folder?: string;
|
|
35
|
+
status?: string;
|
|
36
|
+
extra1?: string;
|
|
37
|
+
extra2?: string;
|
|
38
|
+
extra3?: string;
|
|
39
|
+
extra4?: string;
|
|
40
|
+
extra5?: string;
|
|
41
|
+
parentInternalFileID?: number;
|
|
42
|
+
isFolder?: boolean;
|
|
43
|
+
type?: string;
|
|
44
|
+
aiPimEnabled?: boolean;
|
|
15
45
|
}
|
|
16
46
|
/**
|
|
17
|
-
* Chat message interface
|
|
47
|
+
* Chat message interface. Field names mirror the backend
|
|
48
|
+
* ConversationMessageViewDto so loaded messages pass through without remapping.
|
|
18
49
|
*/
|
|
19
50
|
export interface KRChatbotMessage {
|
|
20
|
-
|
|
51
|
+
type: 'user' | 'assistant';
|
|
21
52
|
content: string;
|
|
22
53
|
reasoning?: string;
|
|
23
|
-
/**
|
|
24
|
-
|
|
54
|
+
/** Internal files attached to this message. */
|
|
55
|
+
internalFiles?: KRChatbotInternalFile[];
|
|
25
56
|
}
|
|
26
57
|
/**
|
|
27
58
|
* Callback function type for sending messages.
|
|
@@ -32,7 +63,7 @@ export interface KRChatbotMessage {
|
|
|
32
63
|
export type KRChatbotSend = (params: {
|
|
33
64
|
message: string;
|
|
34
65
|
messages: KRChatbotMessage[];
|
|
35
|
-
|
|
66
|
+
internalFiles: File[];
|
|
36
67
|
}) => Promise<Response>;
|
|
37
68
|
/**
|
|
38
69
|
* AI chatbot component with SSE streaming.
|
|
@@ -54,7 +85,7 @@ export type KRChatbotSend = (params: {
|
|
|
54
85
|
* ## Usage
|
|
55
86
|
* ```html
|
|
56
87
|
* <kr-chatbot
|
|
57
|
-
*
|
|
88
|
+
* label="AI Assistant"
|
|
58
89
|
* .send=${(params) => {
|
|
59
90
|
* return fetch('/api/ai/chat/stream', {
|
|
60
91
|
* method: 'POST',
|
|
@@ -94,16 +125,25 @@ export declare class KRChatbot extends LitElement {
|
|
|
94
125
|
/**
|
|
95
126
|
* Callback function for sending messages. Receives the user's message and
|
|
96
127
|
* current conversation history. Must return a Response with a streaming SSE body.
|
|
128
|
+
*
|
|
129
|
+
* Optional — when not set, the chatbot uses its built-in default that streams
|
|
130
|
+
* from the Kodaris Bedrock conversation endpoints. Set this to override.
|
|
97
131
|
*/
|
|
98
132
|
send: KRChatbotSend | null;
|
|
99
133
|
/**
|
|
100
134
|
* Callback function called when the user clears the conversation.
|
|
101
135
|
* Must return a Promise — messages are only cleared if it resolves.
|
|
136
|
+
*
|
|
137
|
+
* Optional — when not set, the chatbot uses its built-in default that clears
|
|
138
|
+
* the Kodaris Bedrock conversation state. Set this to override.
|
|
102
139
|
*/
|
|
103
140
|
clear: (() => Promise<unknown>) | null;
|
|
104
141
|
/**
|
|
105
142
|
* Callback function called on init to load existing conversation messages.
|
|
106
143
|
* Must return a Promise that resolves with an array of KRChatbotMessage.
|
|
144
|
+
*
|
|
145
|
+
* Optional — when not set, the chatbot uses its built-in default that loads
|
|
146
|
+
* existing messages from the Kodaris Bedrock conversation. Set this to override.
|
|
107
147
|
*/
|
|
108
148
|
load: (() => Promise<KRChatbotMessage[]>) | null;
|
|
109
149
|
/**
|
|
@@ -112,13 +152,9 @@ export declare class KRChatbot extends LitElement {
|
|
|
112
152
|
*/
|
|
113
153
|
messages: KRChatbotMessage[];
|
|
114
154
|
/**
|
|
115
|
-
* Header
|
|
116
|
-
*/
|
|
117
|
-
title: string;
|
|
118
|
-
/**
|
|
119
|
-
* Header subtitle text (shown below title with a green status dot).
|
|
155
|
+
* Header label text.
|
|
120
156
|
*/
|
|
121
|
-
|
|
157
|
+
label: string;
|
|
122
158
|
/**
|
|
123
159
|
* Input placeholder text.
|
|
124
160
|
*/
|
|
@@ -133,12 +169,22 @@ export declare class KRChatbot extends LitElement {
|
|
|
133
169
|
* then driven via the `open()` / `close()` / `toggle()` methods.
|
|
134
170
|
*/
|
|
135
171
|
hideToggle: boolean;
|
|
172
|
+
/**
|
|
173
|
+
* Layout mode.
|
|
174
|
+
* - `'floating'` (default): the chatbot is a fixed bottom-right widget with a
|
|
175
|
+
* toggle button, and the panel can be dragged and resized. This is the
|
|
176
|
+
* traditional chat-widget appearance.
|
|
177
|
+
* - `'inline'`: the chatbot drops its fixed positioning and fills its parent
|
|
178
|
+
* container (100% width/height, no border radius/shadow, no toggle, no
|
|
179
|
+
* drag/resize). The panel is always open. Use this to embed the chat as a
|
|
180
|
+
* full page or panel region.
|
|
181
|
+
*/
|
|
182
|
+
variant: 'floating' | 'inline';
|
|
136
183
|
private _inputValue;
|
|
137
184
|
private _isStreaming;
|
|
138
|
-
private _statusText;
|
|
139
185
|
private _error;
|
|
140
186
|
/** Images staged in the composer, before the message is sent. */
|
|
141
|
-
private
|
|
187
|
+
private _pendingInternalFiles;
|
|
142
188
|
/** True while a file is being dragged over the panel (shows the drop overlay). */
|
|
143
189
|
private _isDraggingFile;
|
|
144
190
|
private _panelEl;
|
|
@@ -201,8 +247,8 @@ export declare class KRChatbot extends LitElement {
|
|
|
201
247
|
private _addFiles;
|
|
202
248
|
private _removePending;
|
|
203
249
|
private _clearPending;
|
|
204
|
-
/** Open the shared full-screen previewer for
|
|
205
|
-
private
|
|
250
|
+
/** Open the shared full-screen previewer for a message image. */
|
|
251
|
+
private _openImage;
|
|
206
252
|
/** Whether the send button is active: needs text or at least one image. */
|
|
207
253
|
private _canSend;
|
|
208
254
|
private _handleSubmit;
|
package/dist/chatbot.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chatbot.d.ts","sourceRoot":"","sources":["../src/chatbot.ts"],"names":[],"mappings":"AAAA,OAAO,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