@chatwidgetai/chat-widget 0.1.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.
- package/README.md +168 -0
- package/dist/ai-chat-widget.umd.js +65851 -0
- package/dist/ai-chat-widget.umd.js.map +1 -0
- package/dist/api/client.d.ts +48 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/components/ChatWidget.d.ts +9 -0
- package/dist/components/ChatWidget.d.ts.map +1 -0
- package/dist/components/ChatWindow.d.ts +20 -0
- package/dist/components/ChatWindow.d.ts.map +1 -0
- package/dist/components/FeedbackButtons.d.ts +12 -0
- package/dist/components/FeedbackButtons.d.ts.map +1 -0
- package/dist/components/Message.d.ts +17 -0
- package/dist/components/Message.d.ts.map +1 -0
- package/dist/components/MessageInput.d.ts +13 -0
- package/dist/components/MessageInput.d.ts.map +1 -0
- package/dist/components/MessageList.d.ts +19 -0
- package/dist/components/MessageList.d.ts.map +1 -0
- package/dist/components/Sources.d.ts +12 -0
- package/dist/components/Sources.d.ts.map +1 -0
- package/dist/components/SuggestedQuestions.d.ts +11 -0
- package/dist/components/SuggestedQuestions.d.ts.map +1 -0
- package/dist/components/TypingIndicator.d.ts +7 -0
- package/dist/components/TypingIndicator.d.ts.map +1 -0
- package/dist/hooks/useChat.d.ts +35 -0
- package/dist/hooks/useChat.d.ts.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +21669 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +21672 -0
- package/dist/index.js.map +1 -0
- package/dist/types/index.d.ts +143 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/umd.d.ts +25 -0
- package/dist/umd.d.ts.map +1 -0
- package/dist/utils/actionExecutor.d.ts +18 -0
- package/dist/utils/actionExecutor.d.ts.map +1 -0
- package/dist/utils/session.d.ts +12 -0
- package/dist/utils/session.d.ts.map +1 -0
- package/dist/utils/storage.d.ts +28 -0
- package/dist/utils/storage.d.ts.map +1 -0
- package/package.json +56 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API Client for Widget Communication
|
|
3
|
+
* Handles all HTTP requests to the widget API
|
|
4
|
+
*/
|
|
5
|
+
import { WidgetConfig, ConversationMessage } from '../types';
|
|
6
|
+
export interface ApiClientConfig {
|
|
7
|
+
widgetId: string;
|
|
8
|
+
apiKey: string;
|
|
9
|
+
apiUrl: string;
|
|
10
|
+
}
|
|
11
|
+
export declare class WidgetApiClient {
|
|
12
|
+
private config;
|
|
13
|
+
constructor(config: ApiClientConfig);
|
|
14
|
+
/**
|
|
15
|
+
* Get widget configuration
|
|
16
|
+
*/
|
|
17
|
+
getConfig(): Promise<WidgetConfig>;
|
|
18
|
+
getOrCreateConversation(conversationId?: string): Promise<{
|
|
19
|
+
id: string;
|
|
20
|
+
messages: ConversationMessage[];
|
|
21
|
+
}>;
|
|
22
|
+
/**
|
|
23
|
+
* Upload a file
|
|
24
|
+
*/
|
|
25
|
+
uploadFile(conversationId: string, file: File): Promise<{
|
|
26
|
+
id: string;
|
|
27
|
+
filename: string;
|
|
28
|
+
size: number;
|
|
29
|
+
}>;
|
|
30
|
+
/**
|
|
31
|
+
* Send a chat message (standard RAG, no actions)
|
|
32
|
+
* Returns ConversationMessage[] array
|
|
33
|
+
*/
|
|
34
|
+
sendMessage(conversationId: string, message: string, fileIds?: string[]): Promise<ConversationMessage[]>;
|
|
35
|
+
/**
|
|
36
|
+
* Send a message to agent (with actions support)
|
|
37
|
+
*/
|
|
38
|
+
sendAgentMessage(conversationId: string, message: string, fileIds?: string[]): Promise<any>;
|
|
39
|
+
/**
|
|
40
|
+
* Submit feedback for a message
|
|
41
|
+
*/
|
|
42
|
+
submitFeedback(sessionId: string, messageId: string, feedback: 'positive' | 'negative'): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* Validate widget access
|
|
45
|
+
*/
|
|
46
|
+
validateAccess(): Promise<boolean>;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE7D,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAkB;gBAEpB,MAAM,EAAE,eAAe;IAInC;;OAEG;IACG,SAAS,IAAI,OAAO,CAAC,YAAY,CAAC;IAoBlC,uBAAuB,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,mBAAmB,EAAE,CAAA;KAAC,CAAC;IAqB9G;;OAEG;IACG,UAAU,CAAC,cAAc,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAyB7G;;;OAGG;IACG,WAAW,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC;IAyB9G;;OAEG;IACG,gBAAgB,CACpB,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,MAAM,EAAE,GACjB,OAAO,CAAC,GAAG,CAAC;IA4Cf;;OAEG;IACG,cAAc,CAClB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,UAAU,GAAG,UAAU,GAChC,OAAO,CAAC,IAAI,CAAC;IA4BhB;;OAEG;IACG,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;CAsBzC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ChatWidget Component
|
|
3
|
+
* Main widget component with button and chat window
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { WidgetProps } from '../types';
|
|
7
|
+
import '../styles/widget.css';
|
|
8
|
+
export declare const ChatWidget: React.FC<WidgetProps>;
|
|
9
|
+
//# sourceMappingURL=ChatWidget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatWidget.d.ts","sourceRoot":"","sources":["../../src/components/ChatWidget.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAA8B,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAGvC,OAAO,sBAAsB,CAAC;AAE9B,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAkI5C,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ChatWindow Component
|
|
3
|
+
* Main chat interface window
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { ConversationMessage, WidgetConfig } from '../types';
|
|
7
|
+
export interface ChatWindowProps {
|
|
8
|
+
messages: ConversationMessage[];
|
|
9
|
+
isLoading: boolean;
|
|
10
|
+
isTyping: boolean;
|
|
11
|
+
error: string | null;
|
|
12
|
+
config: WidgetConfig | null;
|
|
13
|
+
onSendMessage: (message: string) => void;
|
|
14
|
+
onApproveAction: () => void;
|
|
15
|
+
onRejectAction: () => void;
|
|
16
|
+
onClose: () => void;
|
|
17
|
+
onFeedback: (messageId: string, feedback: 'positive' | 'negative') => void;
|
|
18
|
+
}
|
|
19
|
+
export declare const ChatWindow: React.FC<ChatWindowProps>;
|
|
20
|
+
//# sourceMappingURL=ChatWindow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatWindow.d.ts","sourceRoot":"","sources":["../../src/components/ChatWindow.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAA8B,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAK7D,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,mBAAmB,EAAE,CAAC;IAChC,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;IAC5B,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,GAAG,UAAU,KAAK,IAAI,CAAC;CAC5E;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAgIhD,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FeedbackButtons Component
|
|
3
|
+
* Thumbs up/down buttons for message feedback with instant morph animation
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
export interface FeedbackButtonsProps {
|
|
7
|
+
messageId: string;
|
|
8
|
+
currentFeedback?: 'positive' | 'negative';
|
|
9
|
+
onFeedback: (messageId: string, feedback: 'positive' | 'negative') => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const FeedbackButtons: React.FC<FeedbackButtonsProps>;
|
|
12
|
+
//# sourceMappingURL=FeedbackButtons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FeedbackButtons.d.ts","sourceRoot":"","sources":["../../src/components/FeedbackButtons.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IAC1C,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,GAAG,UAAU,KAAK,IAAI,CAAC;CAC5E;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAuD1D,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Message Component
|
|
3
|
+
* Displays a single chat message with optional sources and feedback
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { ConversationMessage, SourceDisplayMode } from '../types';
|
|
7
|
+
export interface MessageProps {
|
|
8
|
+
message: ConversationMessage;
|
|
9
|
+
showTimestamp?: boolean;
|
|
10
|
+
enableFeedback?: boolean;
|
|
11
|
+
showSources?: boolean;
|
|
12
|
+
sourceDisplayMode?: SourceDisplayMode;
|
|
13
|
+
onFeedback?: (messageId: string, feedback: 'positive' | 'negative') => void;
|
|
14
|
+
toolCallNameById?: Record<string, string>;
|
|
15
|
+
}
|
|
16
|
+
export declare const Message: React.FC<MessageProps>;
|
|
17
|
+
//# sourceMappingURL=Message.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Message.d.ts","sourceRoot":"","sources":["../../src/components/Message.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAA0B,MAAM,UAAU,CAAC;AAI1F,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,mBAAmB,CAAC;IAC7B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,GAAG,UAAU,KAAK,IAAI,CAAC;IAC5E,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC3C;AAED,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAgG1C,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MessageInput Component
|
|
3
|
+
* Text input for sending messages with optional file upload
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
export interface MessageInputProps {
|
|
7
|
+
onSend: (message: string, files?: File[]) => void;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
enableFileUpload?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const MessageInput: React.FC<MessageInputProps>;
|
|
13
|
+
//# sourceMappingURL=MessageInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessageInput.d.ts","sourceRoot":"","sources":["../../src/components/MessageInput.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAA0C,MAAM,OAAO,CAAC;AA2B/D,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAuKpD,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MessageList Component
|
|
3
|
+
* Displays the list of chat messages with auto-scroll
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { ConversationMessage, SourceDisplayMode } from '../types';
|
|
7
|
+
export interface MessageListProps {
|
|
8
|
+
messages: ConversationMessage[];
|
|
9
|
+
isTyping?: boolean;
|
|
10
|
+
showTypingIndicator?: boolean;
|
|
11
|
+
showTimestamps?: boolean;
|
|
12
|
+
enableFeedback?: boolean;
|
|
13
|
+
showSources?: boolean;
|
|
14
|
+
sourceDisplayMode?: SourceDisplayMode;
|
|
15
|
+
welcomeMessage?: string;
|
|
16
|
+
onFeedback?: (messageId: string, feedback: 'positive' | 'negative') => void;
|
|
17
|
+
}
|
|
18
|
+
export declare const MessageList: React.FC<MessageListProps>;
|
|
19
|
+
//# sourceMappingURL=MessageList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessageList.d.ts","sourceRoot":"","sources":["../../src/components/MessageList.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAqC,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAIlE,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,mBAAmB,EAAE,CAAC;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,GAAG,UAAU,KAAK,IAAI,CAAC;CAC7E;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA4DlD,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sources Component
|
|
3
|
+
* Displays source citations for assistant messages with collapsible dropdown
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { KbDocument, SourceDisplayMode } from '../types';
|
|
7
|
+
export interface SourcesProps {
|
|
8
|
+
sources: KbDocument[];
|
|
9
|
+
displayMode?: SourceDisplayMode;
|
|
10
|
+
}
|
|
11
|
+
export declare const Sources: React.FC<SourcesProps>;
|
|
12
|
+
//# sourceMappingURL=Sources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sources.d.ts","sourceRoot":"","sources":["../../src/components/Sources.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAEzD,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,WAAW,CAAC,EAAE,iBAAiB,CAAC;CACjC;AAED,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CA2D1C,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SuggestedQuestions Component
|
|
3
|
+
* Displays clickable suggested questions to help users get started
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
export interface SuggestedQuestionsProps {
|
|
7
|
+
questions: string[];
|
|
8
|
+
onQuestionClick: (question: string) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const SuggestedQuestions: React.FC<SuggestedQuestionsProps>;
|
|
11
|
+
//# sourceMappingURL=SuggestedQuestions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SuggestedQuestions.d.ts","sourceRoot":"","sources":["../../src/components/SuggestedQuestions.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,eAAe,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7C;AAED,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAmChE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TypingIndicator.d.ts","sourceRoot":"","sources":["../../src/components/TypingIndicator.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAUnC,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useChat Hook
|
|
3
|
+
* Main state management for chat functionality
|
|
4
|
+
*/
|
|
5
|
+
import { ConversationMessage, WidgetConfig } from '../types';
|
|
6
|
+
import { ClientAction } from '../utils/actionExecutor';
|
|
7
|
+
export interface UseChatOptions {
|
|
8
|
+
widgetId: string;
|
|
9
|
+
apiKey: string;
|
|
10
|
+
apiUrl: string;
|
|
11
|
+
onMessage?: (message: ConversationMessage) => void;
|
|
12
|
+
onError?: (error: Error) => void;
|
|
13
|
+
}
|
|
14
|
+
export interface PendingAction {
|
|
15
|
+
action: ClientAction;
|
|
16
|
+
message: string;
|
|
17
|
+
continueToken: string;
|
|
18
|
+
messageId: string;
|
|
19
|
+
}
|
|
20
|
+
export interface UseChatReturn {
|
|
21
|
+
messages: ConversationMessage[];
|
|
22
|
+
isLoading: boolean;
|
|
23
|
+
isTyping: boolean;
|
|
24
|
+
error: string | null;
|
|
25
|
+
config: WidgetConfig | null;
|
|
26
|
+
conversationId: string;
|
|
27
|
+
pendingAction: PendingAction | null;
|
|
28
|
+
sendMessage: (content: string) => Promise<void>;
|
|
29
|
+
approveAction: () => Promise<void>;
|
|
30
|
+
rejectAction: () => void;
|
|
31
|
+
clearMessages: () => void;
|
|
32
|
+
submitFeedback: (messageId: string, feedback: 'positive' | 'negative') => Promise<void>;
|
|
33
|
+
}
|
|
34
|
+
export declare function useChat(options: UseChatOptions): UseChatReturn;
|
|
35
|
+
//# sourceMappingURL=useChat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useChat.d.ts","sourceRoot":"","sources":["../../src/hooks/useChat.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAa,MAAM,UAAU,CAAC;AAIxE,OAAO,EAAuB,YAAY,EAAgB,MAAM,yBAAyB,CAAC;AAE1F,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACnD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAClC;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,YAAY,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,mBAAmB,EAAE,CAAC;IAChC,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,aAAa,GAAG,IAAI,CAAC;IACpC,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD,aAAa,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,cAAc,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,GAAG,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACzF;AAED,wBAAgB,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,aAAa,CAoZ9D"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI Chat Widget - Main Entry Point
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
*/
|
|
5
|
+
export { ChatWidget } from './components/ChatWidget';
|
|
6
|
+
export { useChat } from './hooks/useChat';
|
|
7
|
+
export type { WidgetProps, WidgetTheme, WidgetPosition, WidgetSize, WidgetAppearance, WidgetBehavior, WidgetConfig, ConversationMessage, ChatMessage, KbDocument, SourceDisplayMode, ChatState, } from './types';
|
|
8
|
+
export type { UseChatOptions, UseChatReturn, } from './hooks/useChat';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAG1C,YAAY,EACV,WAAW,EACX,WAAW,EACX,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,mBAAmB,EACnB,WAAW,EACX,UAAU,EACV,iBAAiB,EACjB,SAAS,GACV,MAAM,SAAS,CAAC;AAEjB,YAAY,EACV,cAAc,EACd,aAAa,GACd,MAAM,iBAAiB,CAAC"}
|