@clikvn/agent-widget-embedded 0.0.1-dev
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/.eslintrc +34 -0
- package/.prettierrc +8 -0
- package/README.md +20 -0
- package/base.json +21 -0
- package/dist/commons/constants/index.d.ts +2 -0
- package/dist/commons/constants/index.d.ts.map +1 -0
- package/dist/commons/constants/variables.d.ts +5 -0
- package/dist/commons/constants/variables.d.ts.map +1 -0
- package/dist/components/Agent/index.d.ts +3 -0
- package/dist/components/Agent/index.d.ts.map +1 -0
- package/dist/components/Chat/Chat.d.ts +10 -0
- package/dist/components/Chat/Chat.d.ts.map +1 -0
- package/dist/components/Chat/Icons.d.ts +120 -0
- package/dist/components/Chat/Icons.d.ts.map +1 -0
- package/dist/components/Chat/Markdown.d.ts +7 -0
- package/dist/components/Chat/Markdown.d.ts.map +1 -0
- package/dist/components/Chat/Message.d.ts +15 -0
- package/dist/components/Chat/Message.d.ts.map +1 -0
- package/dist/components/Chat/MultimodalInput.d.ts +24 -0
- package/dist/components/Chat/MultimodalInput.d.ts.map +1 -0
- package/dist/components/Chat/Overview.d.ts +8 -0
- package/dist/components/Chat/Overview.d.ts.map +1 -0
- package/dist/components/Chat/PreviewAttachment.d.ts +6 -0
- package/dist/components/Chat/PreviewAttachment.d.ts.map +1 -0
- package/dist/components/Chat/ui/Button.d.ts +12 -0
- package/dist/components/Chat/ui/Button.d.ts.map +1 -0
- package/dist/components/Chat/ui/Textarea.d.ts +6 -0
- package/dist/components/Chat/ui/Textarea.d.ts.map +1 -0
- package/dist/constants.d.ts +2 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/features/AgentWidget/index.d.ts +16 -0
- package/dist/features/AgentWidget/index.d.ts.map +1 -0
- package/dist/hooks/useChat.d.ts +25 -0
- package/dist/hooks/useChat.d.ts.map +1 -0
- package/dist/hooks/useChatData.d.ts +18 -0
- package/dist/hooks/useChatData.d.ts.map +1 -0
- package/dist/hooks/useConfiguration.d.ts +20 -0
- package/dist/hooks/useConfiguration.d.ts.map +1 -0
- package/dist/hooks/useConnection.d.ts +15 -0
- package/dist/hooks/useConnection.d.ts.map +1 -0
- package/dist/hooks/useScrollToBottom.d.ts +6 -0
- package/dist/hooks/useScrollToBottom.d.ts.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/models/FlowiseClient.d.ts +20 -0
- package/dist/models/FlowiseClient.d.ts.map +1 -0
- package/dist/models.d.ts +2 -0
- package/dist/models.d.ts.map +1 -0
- package/dist/register.d.ts +30 -0
- package/dist/register.d.ts.map +1 -0
- package/dist/services/apis.d.ts +7 -0
- package/dist/services/apis.d.ts.map +1 -0
- package/dist/services/bot.service.d.ts +3 -0
- package/dist/services/bot.service.d.ts.map +1 -0
- package/dist/services/chat.service.d.ts +32 -0
- package/dist/services/chat.service.d.ts.map +1 -0
- package/dist/services/user.service.d.ts +3 -0
- package/dist/services/user.service.d.ts.map +1 -0
- package/dist/types/agentType.d.ts +11 -0
- package/dist/types/agentType.d.ts.map +1 -0
- package/dist/types/bot.type.d.ts +11 -0
- package/dist/types/bot.type.d.ts.map +1 -0
- package/dist/types/chat.type.d.ts +10 -0
- package/dist/types/chat.type.d.ts.map +1 -0
- package/dist/types/common.type.d.ts +11 -0
- package/dist/types/common.type.d.ts.map +1 -0
- package/dist/types/flowise.type.d.ts +90 -0
- package/dist/types/flowise.type.d.ts.map +1 -0
- package/dist/types/user.type.d.ts +14 -0
- package/dist/types/user.type.d.ts.map +1 -0
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/commonUtils.d.ts +7 -0
- package/dist/utils/commonUtils.d.ts.map +1 -0
- package/dist/utils/functionUtils.d.ts +3 -0
- package/dist/utils/functionUtils.d.ts.map +1 -0
- package/dist/utils/requestUtils.d.ts +16 -0
- package/dist/utils/requestUtils.d.ts.map +1 -0
- package/dist/utils/streamUtils.d.ts +5 -0
- package/dist/utils/streamUtils.d.ts.map +1 -0
- package/dist/web.d.ts +18 -0
- package/dist/web.d.ts.map +1 -0
- package/dist/web.js +1 -0
- package/dist/window.d.ts +29 -0
- package/dist/window.d.ts.map +1 -0
- package/package.json +91 -0
- package/rollup.config.js +56 -0
- package/src/assets/common.css +148 -0
- package/src/assets/tailwindcss.css +3 -0
- package/src/commons/constants/index.ts +1 -0
- package/src/commons/constants/variables.ts +20 -0
- package/src/components/Agent/index.tsx +14 -0
- package/src/components/Chat/Chat.tsx +84 -0
- package/src/components/Chat/Icons.tsx +883 -0
- package/src/components/Chat/Markdown.tsx +324 -0
- package/src/components/Chat/Message.tsx +185 -0
- package/src/components/Chat/MultimodalInput.tsx +371 -0
- package/src/components/Chat/Overview.tsx +47 -0
- package/src/components/Chat/PreviewAttachment.tsx +41 -0
- package/src/components/Chat/ui/Button.tsx +55 -0
- package/src/components/Chat/ui/Textarea.tsx +23 -0
- package/src/constants.ts +1 -0
- package/src/env.d.ts +10 -0
- package/src/features/AgentWidget/index.tsx +47 -0
- package/src/global.d.ts +1 -0
- package/src/hooks/useChat.ts +225 -0
- package/src/hooks/useChatData.tsx +68 -0
- package/src/hooks/useConfiguration.tsx +54 -0
- package/src/hooks/useScrollToBottom.ts +31 -0
- package/src/index.ts +1 -0
- package/src/models/FlowiseClient.ts +103 -0
- package/src/models.ts +1 -0
- package/src/register.tsx +66 -0
- package/src/services/apis.ts +10 -0
- package/src/services/bot.service.ts +15 -0
- package/src/services/chat.service.ts +164 -0
- package/src/types/bot.type.ts +10 -0
- package/src/types/chat.type.ts +11 -0
- package/src/types/common.type.ts +11 -0
- package/src/types/flowise.type.ts +99 -0
- package/src/types/user.type.ts +15 -0
- package/src/types.ts +0 -0
- package/src/utils/commonUtils.ts +47 -0
- package/src/utils/functionUtils.ts +17 -0
- package/src/utils/requestUtils.ts +113 -0
- package/src/utils/streamUtils.ts +18 -0
- package/src/web.ts +6 -0
- package/src/window.ts +55 -0
- package/tailwind.config.cjs +122 -0
- package/tsconfig.json +24 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { StreamResponse } from '../models/FlowiseClient';
|
|
2
|
+
import { ChatRequestType, ChatType } from '../types/chat.type';
|
|
3
|
+
import { CommonChatType } from '../types/common.type';
|
|
4
|
+
import { AttachmentUploadResult, ChatMessageType, PredictionData } from '../types/flowise.type';
|
|
5
|
+
export declare const createChat: ({ accessToken, req, apiHost, }: {
|
|
6
|
+
accessToken?: string;
|
|
7
|
+
req: ChatRequestType;
|
|
8
|
+
apiHost: string;
|
|
9
|
+
}) => Promise<ChatType>;
|
|
10
|
+
export declare const predict: ({ accessToken, req, onUpdate, apiHost, }: {
|
|
11
|
+
accessToken?: string;
|
|
12
|
+
req: PredictionData;
|
|
13
|
+
apiHost: string;
|
|
14
|
+
onUpdate?: (chunk: StreamResponse) => void;
|
|
15
|
+
}) => Promise<StreamResponse[]>;
|
|
16
|
+
export declare const getChatMessage: ({ accessToken, chatId, apiHost, }: {
|
|
17
|
+
accessToken?: string;
|
|
18
|
+
chatId: string;
|
|
19
|
+
apiHost: string;
|
|
20
|
+
}) => Promise<ChatMessageType[]>;
|
|
21
|
+
export declare const createAttachments: ({ accessToken, chatId, body, apiHost, }: {
|
|
22
|
+
accessToken?: string;
|
|
23
|
+
chatId: string;
|
|
24
|
+
apiHost: string;
|
|
25
|
+
body: any;
|
|
26
|
+
}) => Promise<AttachmentUploadResult[]>;
|
|
27
|
+
export declare const getById: ({ accessToken, id, apiHost, }: {
|
|
28
|
+
accessToken?: string;
|
|
29
|
+
id: string;
|
|
30
|
+
apiHost: string;
|
|
31
|
+
}) => Promise<CommonChatType>;
|
|
32
|
+
//# sourceMappingURL=chat.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat.service.d.ts","sourceRoot":"","sources":["../../src/services/chat.service.ts"],"names":[],"mappings":"AAAA,OAAsB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAQxE,OAAO,EAAE,eAA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.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAI9C,eAAO,MAAM,WAAW,gBAAuB,MAAM,KAAG,OAAO,CAAC,QAAQ,CAUvE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agentType.d.ts","sourceRoot":"","sources":["../../src/types/agentType.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,MAAM,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,GAAG,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bot.type.d.ts","sourceRoot":"","sources":["../../src/types/bot.type.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,MAAM,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,GAAG,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CommonChatType } from './common.type';
|
|
2
|
+
import { UserType } from './user.type';
|
|
3
|
+
export interface ChatType extends CommonChatType {
|
|
4
|
+
user: UserType;
|
|
5
|
+
}
|
|
6
|
+
export interface ChatRequestType {
|
|
7
|
+
title: string;
|
|
8
|
+
chatflowId?: string;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=chat.type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat.type.d.ts","sourceRoot":"","sources":["../../src/types/chat.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,WAAW,QAAS,SAAQ,cAAc;IAC9C,IAAI,EAAE,QAAQ,CAAC;CAChB;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BotType } from './bot.type';
|
|
2
|
+
export interface CommonChatType {
|
|
3
|
+
id: string;
|
|
4
|
+
created?: Date;
|
|
5
|
+
lastModifiedDate?: Date;
|
|
6
|
+
title: string;
|
|
7
|
+
chatflowId: string;
|
|
8
|
+
type: 'PRIVATE' | 'ANONYMOUS';
|
|
9
|
+
bot: BotType;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=common.type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.type.d.ts","sourceRoot":"","sources":["../../src/types/common.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,gBAAgB,CAAC,EAAE,IAAI,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,SAAS,GAAG,WAAW,CAAC;IAC9B,GAAG,EAAE,OAAO,CAAC;CACd"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
export type MessageRoleType = 'apiMessage' | 'userMessage';
|
|
2
|
+
export interface PredictionData {
|
|
3
|
+
chatflowId?: string;
|
|
4
|
+
question: string;
|
|
5
|
+
overrideConfig?: Record<string, any>;
|
|
6
|
+
chatId?: string;
|
|
7
|
+
streaming?: boolean;
|
|
8
|
+
history?: IMessage[];
|
|
9
|
+
uploads?: IFileUpload[];
|
|
10
|
+
leadEmail?: string;
|
|
11
|
+
action?: IAction;
|
|
12
|
+
language?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ChatMessageType {
|
|
15
|
+
action?: IAction;
|
|
16
|
+
artifacts?: any;
|
|
17
|
+
chatId?: string;
|
|
18
|
+
chatType?: string;
|
|
19
|
+
chatflowid?: string;
|
|
20
|
+
content?: string;
|
|
21
|
+
createdDate?: string | Date;
|
|
22
|
+
followUpPrompts?: any;
|
|
23
|
+
id?: string;
|
|
24
|
+
leadEmail?: string;
|
|
25
|
+
role: MessageRoleType;
|
|
26
|
+
sessionId?: string;
|
|
27
|
+
usedTools?: ToolUsage[];
|
|
28
|
+
sourceDocuments?: SourceDocument[];
|
|
29
|
+
fileUploads?: IFileUpload[];
|
|
30
|
+
fileAnnotations?: FileAnnotation[];
|
|
31
|
+
agentReasoning?: AgentReasoning[];
|
|
32
|
+
}
|
|
33
|
+
export interface IAction {
|
|
34
|
+
id?: string;
|
|
35
|
+
elements?: Array<{
|
|
36
|
+
type: string;
|
|
37
|
+
label: string;
|
|
38
|
+
}>;
|
|
39
|
+
mapping?: {
|
|
40
|
+
approve: string;
|
|
41
|
+
reject: string;
|
|
42
|
+
toolCalls: any[];
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export interface IFileUpload {
|
|
46
|
+
tempId?: string;
|
|
47
|
+
data?: string;
|
|
48
|
+
type: string;
|
|
49
|
+
name: string;
|
|
50
|
+
mime: string;
|
|
51
|
+
}
|
|
52
|
+
export interface IMessage {
|
|
53
|
+
message: string;
|
|
54
|
+
type: MessageRoleType;
|
|
55
|
+
role?: MessageRoleType;
|
|
56
|
+
content?: string;
|
|
57
|
+
}
|
|
58
|
+
export interface ToolUsage {
|
|
59
|
+
tool: string;
|
|
60
|
+
toolInput: {
|
|
61
|
+
input: string;
|
|
62
|
+
};
|
|
63
|
+
toolOutput: string;
|
|
64
|
+
}
|
|
65
|
+
export interface SourceDocument {
|
|
66
|
+
pageContent: string;
|
|
67
|
+
metadata: {
|
|
68
|
+
author: string;
|
|
69
|
+
date: string;
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
export interface AgentReasoning {
|
|
73
|
+
agentName: string;
|
|
74
|
+
messages: string[];
|
|
75
|
+
nodeName: string;
|
|
76
|
+
nodeId: string;
|
|
77
|
+
usedTools: ToolUsage[];
|
|
78
|
+
sourceDocuments: SourceDocument[];
|
|
79
|
+
}
|
|
80
|
+
export interface FileAnnotation {
|
|
81
|
+
filePath: string;
|
|
82
|
+
fileName: string;
|
|
83
|
+
}
|
|
84
|
+
export interface AttachmentUploadResult {
|
|
85
|
+
name: string;
|
|
86
|
+
mimeType: string;
|
|
87
|
+
size: string;
|
|
88
|
+
content: string;
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=flowise.type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flowise.type.d.ts","sourceRoot":"","sources":["../../src/types/flowise.type.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG,YAAY,GAAG,aAAa,CAAC;AAE3D,MAAM,WAAW,cAAc;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,QAAQ,EAAE,CAAC;IACrB,OAAO,CAAC,EAAE,WAAW,EAAE,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IA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C;IACtB,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE;QACT,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE;QACR,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH;AAED,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,SAAS,EAAE,CAAC;IACvB,eAAe,EAAE,cAAc,EAAE,CAAC;CACnC;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CommonChatType } from './common.type';
|
|
2
|
+
export interface UserType {
|
|
3
|
+
id: string;
|
|
4
|
+
created?: Date;
|
|
5
|
+
lastModifiedDate?: Date;
|
|
6
|
+
phoneNumber?: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
email: string;
|
|
9
|
+
userClik: number;
|
|
10
|
+
chats?: CommonChatType[];
|
|
11
|
+
user?: number;
|
|
12
|
+
authorities?: string[];
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=user.type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.type.d.ts","sourceRoot":"","sources":["../../src/types/user.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,gBAAgB,CAAC,EAAE,IAAI,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,cAAc,EAAE,CAAC;IAEzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ClassValue } from 'clsx';
|
|
2
|
+
export declare const cn: (...inputs: ClassValue[]) => string;
|
|
3
|
+
export declare function getLocalStorage(key: string): any;
|
|
4
|
+
export declare function generateUUID(): string;
|
|
5
|
+
export declare const generateExtendedFileName: (originalFileName: string) => string;
|
|
6
|
+
export declare const sleep: (duration: number) => Promise<void>;
|
|
7
|
+
//# sourceMappingURL=commonUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commonUtils.d.ts","sourceRoot":"","sources":["../../src/utils/commonUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAQ,MAAM,MAAM,CAAC;AAG7C,eAAO,MAAM,EAAE,cAAe,UAAU,EAAE,WAEzC,CAAC;AAEF,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,OAK1C;AAED,wBAAgB,YAAY,IAAI,MAAM,CAMrC;AAED,eAAO,MAAM,wBAAwB,qBAAsB,MAAM,WAoBhE,CAAC;AAEF,eAAO,MAAM,KAAK,aAAoB,MAAM,KAAG,OAAO,CAAC,IAAI,CAE1D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"functionUtils.d.ts","sourceRoot":"","sources":["../../src/utils/functionUtils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,QAAS,GAAG,KAAG,OAElC,CAAC;AAEF,eAAO,MAAM,OAAO,WAAY,GAAG,+BAYlC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type RequestPropsTypes = {
|
|
2
|
+
host?: string;
|
|
3
|
+
url?: string;
|
|
4
|
+
method?: 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
5
|
+
streamProtocol?: 'data' | 'text';
|
|
6
|
+
onStreamUpdate?: (chunks: {
|
|
7
|
+
content: string;
|
|
8
|
+
}[]) => void;
|
|
9
|
+
onStreamFinish?: (result: {
|
|
10
|
+
content: string;
|
|
11
|
+
}) => void;
|
|
12
|
+
[x: string]: any;
|
|
13
|
+
};
|
|
14
|
+
export declare const request: (props: RequestPropsTypes) => Promise<any>;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=requestUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requestUtils.d.ts","sourceRoot":"","sources":["../../src/utils/requestUtils.ts"],"names":[],"mappings":"AAGA,KAAK,iBAAiB,GAAG;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC;IAC3C,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,KAAK,IAAI,CAAC;IACzD,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACvD,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;CAClB,CAAC;AAIF,eAAO,MAAM,OAAO,UAAiB,iBAAiB,KAAG,OAAO,CAAC,GAAG,CAiGnE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streamUtils.d.ts","sourceRoot":"","sources":["../../src/utils/streamUtils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,4BAG3B;IACD,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;IACnC,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CACrD,KAAG,OAAO,CAAC,IAAI,CAWf,CAAC"}
|
package/dist/web.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare const agentVoice: {
|
|
2
|
+
initWidget: (props: {
|
|
3
|
+
apiHost: string;
|
|
4
|
+
agentId: string;
|
|
5
|
+
overrideConfig?: {
|
|
6
|
+
chatId?: string | undefined;
|
|
7
|
+
} & Record<string, unknown>;
|
|
8
|
+
theme?: {
|
|
9
|
+
avatar?: string;
|
|
10
|
+
} & Record<string, unknown>;
|
|
11
|
+
listeners?: Record<import("./models").EVENT_TYPE, (props: any) => void>;
|
|
12
|
+
} & {
|
|
13
|
+
id?: string;
|
|
14
|
+
}) => void;
|
|
15
|
+
destroy: () => void;
|
|
16
|
+
};
|
|
17
|
+
export default agentVoice;
|
|
18
|
+
//# sourceMappingURL=web.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web.d.ts","sourceRoot":"","sources":["../src/web.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,UAAU;;;;;kBAIyF,CAAC;;;kBAA2E,CAAC;;;;UAA6J,CAAC;;;CAJhT,CAAC;AAGrC,eAAe,UAAU,CAAC"}
|