@clikvn/agent-widget-embedded 0.0.39-dev → 0.0.41-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.
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="WEB_MODULE" version="4">
3
+ <component name="NewModuleRootManager">
4
+ <content url="file://$MODULE_DIR$">
5
+ <excludeFolder url="file://$MODULE_DIR$/.tmp" />
6
+ <excludeFolder url="file://$MODULE_DIR$/temp" />
7
+ <excludeFolder url="file://$MODULE_DIR$/tmp" />
8
+ </content>
9
+ <orderEntry type="inheritedJdk" />
10
+ <orderEntry type="sourceFolder" forTests="false" />
11
+ </component>
12
+ </module>
@@ -0,0 +1,59 @@
1
+ <component name="ProjectCodeStyleConfiguration">
2
+ <code_scheme name="Project" version="173">
3
+ <HTMLCodeStyleSettings>
4
+ <option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />
5
+ </HTMLCodeStyleSettings>
6
+ <JSCodeStyleSettings version="0">
7
+ <option name="FORCE_SEMICOLON_STYLE" value="true" />
8
+ <option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
9
+ <option name="USE_DOUBLE_QUOTES" value="false" />
10
+ <option name="FORCE_QUOTE_STYlE" value="true" />
11
+ <option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
12
+ <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
13
+ <option name="SPACES_WITHIN_IMPORTS" value="true" />
14
+ </JSCodeStyleSettings>
15
+ <TypeScriptCodeStyleSettings version="0">
16
+ <option name="FORCE_SEMICOLON_STYLE" value="true" />
17
+ <option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
18
+ <option name="USE_DOUBLE_QUOTES" value="false" />
19
+ <option name="FORCE_QUOTE_STYlE" value="true" />
20
+ <option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
21
+ <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
22
+ <option name="SPACES_WITHIN_IMPORTS" value="true" />
23
+ </TypeScriptCodeStyleSettings>
24
+ <VueCodeStyleSettings>
25
+ <option name="INTERPOLATION_NEW_LINE_AFTER_START_DELIMITER" value="false" />
26
+ <option name="INTERPOLATION_NEW_LINE_BEFORE_END_DELIMITER" value="false" />
27
+ </VueCodeStyleSettings>
28
+ <codeStyleSettings language="HTML">
29
+ <option name="SOFT_MARGINS" value="80" />
30
+ <indentOptions>
31
+ <option name="INDENT_SIZE" value="2" />
32
+ <option name="CONTINUATION_INDENT_SIZE" value="2" />
33
+ <option name="TAB_SIZE" value="2" />
34
+ </indentOptions>
35
+ </codeStyleSettings>
36
+ <codeStyleSettings language="JavaScript">
37
+ <option name="SOFT_MARGINS" value="80" />
38
+ <indentOptions>
39
+ <option name="INDENT_SIZE" value="2" />
40
+ <option name="CONTINUATION_INDENT_SIZE" value="2" />
41
+ <option name="TAB_SIZE" value="2" />
42
+ </indentOptions>
43
+ </codeStyleSettings>
44
+ <codeStyleSettings language="TypeScript">
45
+ <option name="SOFT_MARGINS" value="80" />
46
+ <indentOptions>
47
+ <option name="INDENT_SIZE" value="2" />
48
+ <option name="CONTINUATION_INDENT_SIZE" value="2" />
49
+ <option name="TAB_SIZE" value="2" />
50
+ </indentOptions>
51
+ </codeStyleSettings>
52
+ <codeStyleSettings language="Vue">
53
+ <option name="SOFT_MARGINS" value="80" />
54
+ <indentOptions>
55
+ <option name="CONTINUATION_INDENT_SIZE" value="2" />
56
+ </indentOptions>
57
+ </codeStyleSettings>
58
+ </code_scheme>
59
+ </component>
@@ -0,0 +1,5 @@
1
+ <component name="ProjectCodeStyleConfiguration">
2
+ <state>
3
+ <option name="USE_PER_PROJECT_SETTINGS" value="true" />
4
+ </state>
5
+ </component>
@@ -0,0 +1,6 @@
1
+ <component name="InspectionProjectProfileManager">
2
+ <profile version="1.0">
3
+ <option name="myName" value="Project Default" />
4
+ <inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
5
+ </profile>
6
+ </component>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="EslintConfiguration">
4
+ <custom-configuration-file used="true" path="$PROJECT_DIR$/.eslintrc" />
5
+ </component>
6
+ </project>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/clik-ai-chatbot-embedded.iml" filepath="$PROJECT_DIR$/.idea/clik-ai-chatbot-embedded.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="PrettierConfiguration">
4
+ <option name="myConfigurationMode" value="AUTOMATIC" />
5
+ </component>
6
+ </project>
package/.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
+ </component>
6
+ </project>
@@ -1 +1 @@
1
- {"version":3,"file":"AudioPlayer.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/AudioPlayer.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAI3D,QAAA,MAAM,WAAW,mCAId;IACD,OAAO,EAAE,eAAe,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,4CAmKA,CAAC;AAEF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"AudioPlayer.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/AudioPlayer.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAI3D,QAAA,MAAM,WAAW,mCAId;IACD,OAAO,EAAE,eAAe,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,4CAsMA,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { FC } from 'react';
2
+ type Props = {
3
+ addRecordingToPreviews: (blob: Blob) => void;
4
+ isRecording: boolean;
5
+ setIsRecording: (value: boolean) => void;
6
+ };
7
+ export declare const AudioRecording: FC<Props>;
8
+ export {};
9
+ //# sourceMappingURL=AudioRecording.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AudioRecording.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/AudioRecording.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAuB,MAAM,OAAO,CAAC;AAShD,KAAK,KAAK,GAAG;IACX,sBAAsB,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAC7C,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1C,CAAC;AACF,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,KAAK,CAiEpC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ interface ModalProps {
3
+ onClose: () => void;
4
+ children: React.ReactNode;
5
+ }
6
+ declare const Modal: React.FC<ModalProps>;
7
+ export default Modal;
8
+ //# sourceMappingURL=Modal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,UAAU,UAAU;IAClB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,QAAA,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAc/B,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ type TokenGeneratorData = {
3
+ shouldConnect: boolean;
4
+ wsUrl: string;
5
+ token: string;
6
+ disconnect: () => Promise<void>;
7
+ connect: () => Promise<void>;
8
+ };
9
+ export declare const ConnectionProvider: ({ children, livekitURL, }: {
10
+ children: React.ReactNode;
11
+ livekitURL: string;
12
+ }) => import("react/jsx-runtime").JSX.Element;
13
+ export declare const useConnection: () => TokenGeneratorData;
14
+ export {};
15
+ //# sourceMappingURL=useConnection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useConnection.d.ts","sourceRoot":"","sources":["../../src/hooks/useConnection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkC,MAAM,OAAO,CAAC;AAIvD,KAAK,kBAAkB,GAAG;IACxB,aAAa,EAAE,OAAO,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAChC,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B,CAAC;AAMF,eAAO,MAAM,kBAAkB,8BAG5B;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;CACpB,4CA6CA,CAAC;AAEF,eAAO,MAAM,aAAa,0BAMzB,CAAC"}
package/dist/index.html CHANGED
@@ -1,108 +1,47 @@
1
- <!doctype html>
1
+ <!DOCTYPE html>
2
2
  <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <title></title>
6
- <script type="module">
7
- import Agent from 'http://localhost:3000/web.js'; // Change to from './web.js' to 'https://localhost:5678/web.js'
8
- Agent.initWidget({
9
- apiHost: 'http://localhost:8085/chatbot',
10
- agentId: '6d02b23f-465f-44ec-8766-27a82890a9b8',
11
- theme: {
12
- input: {
13
- placeholder: 'Tin nhắn...',
14
- },
15
- overview: {
16
- title: 'Van Mieu, Quoc Tu Giam',
17
- description:
18
- 'Your personal AI tutor by Khan Academy! Im Khanmigo Lite - here to help you with math, science, and humanities and questions.',
19
- },
20
- header: {
21
- title: 'tung test',
22
- },
23
- language: {
24
- code: 'global',
25
- options: [
26
- {
27
- name: 'en',
28
- code: 'global',
29
- },
30
- {
31
- name: 'vi',
32
- code: 'vi',
33
- },
34
- {
35
- name: 'us',
36
- code: 'en',
37
- },
38
- {
39
- name: 'jp',
40
- code: 'jp',
41
- },
42
- {
43
- name: 'kr',
44
- code: 'kr',
45
- },
46
- {
47
- name: 'cn',
48
- code: 'cn',
49
- },
50
- {
51
- name: 'th',
52
- code: 'th',
53
- },
54
- {
55
- name: 'tw',
56
- code: 'tw',
57
- },
58
- {
59
- name: 'sg',
60
- code: 'sg',
61
- },
62
- {
63
- name: 'my',
64
- code: 'my',
65
- },
66
- {
67
- name: 'kh',
68
- code: 'kh',
69
- },
70
- {
71
- name: 'au',
72
- code: 'au',
73
- },
74
- ],
75
- },
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <title></title>
6
+ <script type="module">
7
+ import Agent from 'http://localhost:3000/web.js'; // Change to from './web.js' to 'https://localhost:5678/web.js'
8
+ Agent.initWidget({
9
+ apiHost: 'http://localhost:8085/chatbot',
10
+ agentId: 'cd49f913-b0e4-4395-8beb-0d74f34d58cc',
11
+ voice: {
12
+ livekitUrl: 'wss://clik-dev-t95ky4ge.livekit.cloud'
13
+ },
14
+ theme: {
15
+ input: {
16
+ placeholder: 'Tin nhắn...'
76
17
  },
18
+ overview: {
19
+ title: 'Van Mieu, Quoc Tu Giam',
20
+ description: 'Your personal AI tutor by Khan Academy! Im Khanmigo Lite - here to help you with math, science, and humanities and questions.'
21
+ }
22
+ },
23
+ overrideConfig: {
24
+ chatId: '14342fe3-8991-4a67-afea-b1c4266da127',
77
25
  overrideConfig: {
78
- // chatId: '14342fe3-8991-4a67-afea-b1c4266da82b',
79
- chatId: 'f547e5e3-363f-425c-adc1-7f618330d551',
80
- overrideConfig: {
81
- vars: {
82
- POI_CODE: 'MLI_VKLVVAJEFHLH',
83
- LANGUAGE: 'US',
84
- },
85
- },
86
- // suggestedActions: [
87
- // {
88
- // title: 'How are you?',
89
- // label: 'are you?',
90
- // action: 'How are you?'
91
- // }
92
- // ]
26
+ vars: {
27
+ POI_CODE: 'MLI_VKLVVAJEFHLH',
28
+ LANGUAGE: 'VN'
29
+ }
93
30
  },
94
- });
95
- </script>
96
- <style>
97
- .chatbox {
31
+
32
+ },
33
+ });
34
+ </script>
35
+ <style>
36
+ .chatbox {
98
37
  width: 100%;
99
38
  height: 100vh;
100
- }
101
- </style>
102
- </head>
103
- <body>
104
- <div class="chatbox">
105
- <clik-agent-widget></clik-agent-widget>
106
- </div>
107
- </body>
39
+ }
40
+ </style>
41
+ </head>
42
+ <body>
43
+ <div class="chatbox">
44
+ <clik-agent-widget></clik-agent-widget>
45
+ </div>
46
+ </body>
108
47
  </html>
@@ -0,0 +1,3 @@
1
+ import { UserType } from '../types/user.type';
2
+ export declare const getUserInfo: (accessToken: string) => Promise<UserType>;
3
+ //# sourceMappingURL=user.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user.service.d.ts","sourceRoot":"","sources":["../../src/services/user.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,11 @@
1
+ export interface AgentType {
2
+ id: string;
3
+ created: string;
4
+ lastModifiedDate: string;
5
+ name: string;
6
+ chatflowId: string;
7
+ chatflowConfig: any;
8
+ hidden: boolean;
9
+ avatar: string;
10
+ }
11
+ //# sourceMappingURL=agentType.d.ts.map
@@ -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"}